-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Added OAuth2 GET and POST to GraphRBAC.json spec #3563
Conversation
Can one of the admins verify this patch? |
Automation for azure-sdk-for-rubyThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-nodeThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-pythonThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-javaThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-goThe initial PR has been merged into your service PR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for being mindful of deployment as you submitted your change.
There are a couple of ways forward:
- Changes are getting deployed relatively soon: you can just make these changes to the existing stable definition of graphrbac. We'll just throw the DoNotMerge label on, and set a timeline for when it should get merged.
- If it's going to be a while, and you'd like to publish preview packages in the Go & Python SDKs, move these changes to
specification/graphrbac/data-plane/preview/1.6/graphrbac.json
. - It's going to be a while, but there's no use publishing preview packages publicly: Create a branch in this repository by joining the GitHub team azure-rest-api-writers. Instructions on joining that team here. We can update this PR to target that branch and make the changes to the existing stable file. Then I'll review/approve the changes. When the changes are deployed server side, you can submit a new PR from the staging branch to master. Give this PR as context so the automatically assigned reviewer knows they don't need to do any further review.
Thanks @marstr , I went for option 1 |
@AutorestCI regenerate azure-sdk-for-go |
@marstr , the Linter is failing on legacy items not related to my changes, please advise on how you would like me to proceed. |
@AutorestCI regenerate azure-sdk-for-go |
A downstream PR for az cli has a dependency on this PR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay on this, @shanepeckham.
In regards to the new ARM errors, I glanced through and validated that none of them will be required by us. Though, I would personally recommend adding examples to help us validate/test your API.
@@ -2985,6 +3054,52 @@ | |||
} | |||
}, | |||
"description": "Server response for Get tenant domains API call." | |||
}, | |||
"OAuth2" : { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the linter, having this share a name with the Operation Group will create a naming conflict in the generated SDKs. Left unchanged, AutoRest will automatically rename this "OAuth2Model". Given context, I'm not sure )Auth2 is a very expressive name for this anyway. Maybe something like "GrantRequest" or "GrantPermission"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marstr , I will change this to Permissions in anticipation that we can add a revoke in the future which does not seem to exist at this stage
"x-examples" : { | ||
"application/json" : "{\n\t\"odata.type\": \"Microsoft.DirectoryServices.OAuth2PermissionGrant\",\n\t\"clientId\": \"39afbaa2-4a5c-4f5b-9ee3-2c83f09bbc87\", \n\t\"consentType\": \"AllPrincipals\",\n\t\"principalId\": null,\n\t\"resourceId\": \"d3247842-c517-4520-80a7-332690ae2fe4\",\n\t\"scope\": \"user_impersonation\",\n \"startTime\": \"0001-01-01T00:00:00\",\n \"expiryTime\": \"9000-01-01T00:00:00\"\n}" | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter is also complaining about not having a "description" field here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a description
"in" : "query", | ||
"required" : false, | ||
"type" : "string", | ||
"x-example" : "clientId+eq+'61ed44c3-5a1d-4639-a215-07f25129c6c3'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter is complaining about not having a "description" property here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a description
@marstr All requested changes applied |
d2bcb30
to
1387884
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than my one comment, this PR LGTM.
@marstr we have another PR dependant on this one which has also been approved Azure/azure-cli#6975 |
@marstr Sample for granting permission i.e. POST to
To test if it worked GET:
|
@marstr can correct me, but @shanepeckham you might need to fix one lint error by change
|
@yugangw-msft , @marstr , the linter error reported (R3016 - DefinitionsPropertiesNamesCamelCase) appears throughout the document on legacy items and to me seems related to the '.' (full stop) in the property name, not the case. Is this correct? |
@marstr are you able to clarify? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarifying my expectations from the linter :)
Many of the errors that are reported aren't actually new.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter errors that are being reported are all now ARM specific requirements, therefor this data-plane library is not beholden to them. (Though for the record, it may help you to add more examples)
Let me know when you're ready for me to merge this from the server side. Our expectation is that it is ready for public consumption in at least one Azure region. |
Thank you @marstr , we are good to go. |
* Adding Microsoft.Solutions 2021-02-01-preview Same state as RPSaaSDev * fix swagger LintDiff errors * Fix LilntDiff and add more examples * Fix examples and ModelValidation * Fix jitscheduling policy * another attempt to fix ModelValidation * nit * Update updateJitRequest.json
* Revert "Adding Microsoft.Solutions 2021-02-01-preview (#3563)" This reverts commit ff3bc45. * Revert "Revert "Adding Microsoft.Solutions 2021-02-01-preview (#3563)"" This reverts commit 722eafe10cfb14fcc7aae8a620fcc020e46139cb. * Adding new APIs for VM extension * adding agent version * adding suppression for secrets * supressing api key * corrected api version * fixed typo * updating the summary * updating description * resolving warnings * Update logz.json
Purpose of PR
This is needed so that we can programmatically grant OAuth2 consent to an application in Azure Active Directory - we need this in the Python and Go SDKs for Azure. This is the supported and correct way to do this respecting customer approval workflows. Example use case includes Azure Kubernetes Service RBAC integration with Azure Active Directory.
Added to stable. What has been added:
In paths:
And in definitions:
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-version
in the path should match theapi-version
in the spec).Quality of Swagger