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

Project API key create and list #114

Merged
merged 5 commits into from Jan 24, 2023
Merged

Project API key create and list #114

merged 5 commits into from Jan 24, 2023

Conversation

pdeziel
Copy link
Contributor

@pdeziel pdeziel commented Jan 24, 2023

Scope of changes

This implements the project API key create and list handlers in Tenant. Note that there's some more work to be done as mentioned in the TODOs regarding security checks to make sure users are not able to interact with projects they are not a part of.

Fixes SC-10407

Type of change

  • new feature
  • bug fix
  • documentation
  • testing
  • technical debt
  • other (describe)

Acceptance criteria

Describe how reviewers can test this change to be sure that it works correctly. Add a checklist if possible.

Author checklist

  • I have manually tested the change and/or added automation in the form of unit tests or integration tests
  • I have updated the dependencies list
  • I have recompiled and included new protocol buffers to reflect changes I made
  • I have added new test fixtures as needed to support added tests
  • Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself)
  • I have moved the associated Shortcut story to "Ready for Review"

Reviewer(s) checklist

  • Any new user-facing content that has been added for this PR has been QA'ed to ensure correct grammar, spelling, and understandability.

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #10407: Implement APIKey Resource Create/List Handlers.

// TODO: Validate the auth token
w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(http.StatusUnauthorized)
w.Write([]byte("missing authorization header"))
Copy link
Contributor Author

@pdeziel pdeziel Jan 24, 2023

Choose a reason for hiding this comment

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

Updated the quarterdeck mock so we can verify that the client is actually sending the authorization token to quarterdeck in tests.

c.JSON(http.StatusNotImplemented, "not implemented yet")
}

// TODO: Implement by factoring out common code from ProjectAPIKeyCreate
Copy link
Contributor

Choose a reason for hiding this comment

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

While reviewing older correspondence, I thought that API Keys would only be created within a project. This is why the client APIKeyCreate was previously removed along with the client info removed (sorry!).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I think there was (and might still be) some uncertainty about that. I think the original idea was that API keys could be created on either the organization level or within a specific project. It doesn't really matter to quarterdeck however since the projectID is an optional parameter in quarterdeck's CreateAPIKey handler.

Copy link
Contributor

@daniellemaxwell daniellemaxwell left a comment

Choose a reason for hiding this comment

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

Great work! There's only one very small suggestion.

pdeziel and others added 2 commits January 24, 2023 14:21
Co-authored-by: Danielle <danielle@rotational.io>
@pdeziel pdeziel merged commit 9eb59c3 into main Jan 24, 2023
@pdeziel pdeziel deleted the sc-10407 branch January 24, 2023 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants