cacti icon indicating copy to clipboard operation
cacti copied to clipboard

refactor(cmd-api-server): pull OAuth2 endpoint scopes from openapi.json

Open aldousalvarez opened this issue 1 year ago • 1 comments

Commit to be reviewed


refactor(cmd-api-server): pull OAuth2 endpoint scopes from openapi.json

Primary Changes
----------------
1. added OAuth2 security endpoints scopes to openapi.json
2. added a test to make sure if the scopes are indeed getting 
   pulled from the spec file

Fixes #2693

Pull Request Requirements

  • [x] Rebased onto upstream/main branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.
  • [x] Have git sign off at the end of commit message to avoid being marked red. You can add -s flag when using git commit command. You may refer to this link for more information.
  • [x] Follow the Commit Linting specification. You may refer to this link for more information.

Character Limit

  • [x] Pull Request Title and Commit Subject must not exceed 72 characters (including spaces and special characters).
  • [x] Commit Message per line must not exceed 80 characters (including spaces and special characters).

A Must Read for Beginners For rebasing and squashing, here's a must read guide for beginners.

aldousalvarez avatar Aug 07 '24 05:08 aldousalvarez

Hello @petermetz, Already done the requested changes, re-requested for your review. Thank you

aldousalvarez avatar Aug 21 '24 15:08 aldousalvarez

Hello @petermetz I added another test case where it would be 403, and then I also added that it logs which status code it gets,. Should I also add 403 in the responses on the openapi.json as well? Thanks

aldousalvarez avatar Oct 21 '24 11:10 aldousalvarez

Hello @petermetz I added another test case where it would be 403, and then I also added that it logs which status code it gets,. Should I also add 403 in the responses on the openapi.json as well? Thanks

@aldousalvarez Sorry for the slow response! Thank you for the changes and to your question: Yes, please declare the 403 in the openapi.tpl.json spec as well (and make sure to run codegen so that it updates openapi.json also)

petermetz avatar Oct 31 '24 18:10 petermetz

Hello @petermetz re-requested for review. already done with the requested changes and updated some of the tests with the required scope after running yarn run codegen so the tests would pass. Thank you

aldousalvarez avatar Nov 06 '24 04:11 aldousalvarez