Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api-key): Add the endpoints and workflows for api key module #6471

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

sradevski
Copy link
Member

Added endpoints for managing API keys, as well as the workflows and related necessary changes.

Copy link

changeset-bot bot commented Feb 22, 2024

⚠️ No Changeset found

Latest commit: 0582545

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Feb 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 23, 2024 10:05am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Feb 23, 2024 10:05am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Feb 23, 2024 10:05am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Feb 23, 2024 10:05am

@sradevski sradevski force-pushed the feat/add-api-endpoints-api-key branch from a96989d to 0582545 Compare February 23, 2024 10:01
@sradevski sradevski marked this pull request as ready for review February 23, 2024 10:06
@sradevski sradevski requested review from a team as code owners February 23, 2024 10:06
Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good 🔥 a couple of comments to look at 👍

@@ -180,8 +178,7 @@ moduleIntegrationTestRunner({
it("should not reflect any updates on other fields", async function () {
const createdApiKey = await service.create(createSecretKeyFixture)

const updatedApiKey = await service.update({
id: createdApiKey.id,
const updatedApiKey = await service.update(createdApiKey.id, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: why did we move the id here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adrien2p I just followed the API pattern of the region, as I assumed that's how we want all modules to behave

* Update an api key
* @param data
*/
update(data: UpdateApiKeyDTO[]): Promise<ApiKeyDTO[]>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: missing shared context, also, is the selector based approach needed here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, it would be better to have the shared context at always the same position as the index of the shared context is stored on the class through the decorator and then used to identify where to put it. Here the second argument of the method could then be data or shared context and can create issues. Maybe an huddle would be easier if you want to discuss it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adrien2p similar to above, I just followed the API pattern of the region, as I assumed that's how we want all modules to behave.

I think we just need to standardize how all modules behave basically, as I am not sure what the "expected" public API for each module is.

I would suggest we do the discussion separately from the PR, and we go with this one as it is, and then we modify all modules at once that don't follow the convention.

Copy link
Member

@adrien2p adrien2p Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do agree on the standardization for sure 👍 though, you will have an issue with the context coming from a workflow for example. This should be handled now, @olivermrbl you also have the issue in the region I conclude. so it should be handled too cc @carlos-r-l-rodrigues

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adrien2p let me merge this and I'll update it in the follow-up PR where I enforce the usage of the authentication, since this already built and passed 😄

@sradevski sradevski merged commit 78b6d46 into develop Feb 23, 2024
17 checks passed
@sradevski sradevski deleted the feat/add-api-endpoints-api-key branch February 23, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants