feat: Add created_by to MasterAPIKey model#6845
Conversation
…ng other API Keys
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6845 +/- ##
=======================================
Coverage 98.33% 98.33%
=======================================
Files 1336 1337 +1
Lines 49615 49628 +13
=======================================
+ Hits 48790 48803 +13
Misses 825 825 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Docker builds report
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
|
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
|
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
|
Zaimwa9
left a comment
There was a problem hiding this comment.
Code looks good and safe to me, haven't tested it yet, will do but approving to not block
| <Row className='table-header'> | ||
| <Flex className='table-column px-3'>API Keys</Flex> | ||
| <Flex className='table-column'>Created</Flex> | ||
| {Utils.getFlagsmithHasFeature( |
There was a problem hiding this comment.
Actually the organisation store is empty on this page. It needs to be dispatched the old way (hello ClassComponents).
You'll need something like this otherwise organisationStore.model?.users is empty and fallbacks on -
import AppActions from 'common/dispatcher/app-actions'
componentDidMount() {
this.fetch()
AppActions.getOrganisation(this.props.organisationId)
OrganisationStore.on('change', this.handleOrgStoreChange)
}
componentDidUpdate() {
if (this.props.organisationId === this.state.organisationId) return
this.fetch()
AppActions.getOrganisation(this.props.organisationId)
this.setState({ organisationId: this.props.organisationId })
}
componentWillUnmount() {
OrganisationStore.off('change', this.handleOrgStoreChange)
}
handleOrgStoreChange = () => {
this.forceUpdate()
}
There was a problem hiding this comment.
I'm a bit confused by this comment for a couple of reasons:
- The comment is attached to a line related to the flagsmith SDK, and determining if the flag is enabled or not.
- If the organisation store was empty, wouldn't we not see any names populated in the list? Doesn't your screenshot prove that's not the case?
I'm sure there's something I'm missing here, but I'd like to understand a little more about what the issue is before I blindly fix it with your suggestion 😃
There was a problem hiding this comment.
Yes my bad, I don't know how I ended up on this line:
- Wrong comment line from my side
- I wasn't clear on this part but the screenshot comes from trying the fix locally to get to the root cause. The response payload was correct but defaulting to
-because of the empty store
Zaimwa9
left a comment
There was a problem hiding this comment.
Approving following offline discussion unless we have a stable way to reproduce the fallback behavior I experienced

Changes
Add 'created by' to Organisation API keys for better auditing.
How did you test this code?
Updated existing unit test and tested frontend changes locally.