-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[keyvault] add scope enum #13516
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
Merged
Merged
[keyvault] add scope enum #13516
Changes from 3 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -13,6 +13,7 @@ | |||||||||||
from typing import Any, Union | ||||||||||||
from uuid import UUID | ||||||||||||
from azure.core.paging import ItemPaged | ||||||||||||
from ._models import KeyVaultRoleScope | ||||||||||||
|
||||||||||||
|
||||||||||||
class KeyVaultAccessControlClient(KeyVaultClientBase): | ||||||||||||
|
@@ -27,10 +28,12 @@ class KeyVaultAccessControlClient(KeyVaultClientBase): | |||||||||||
|
||||||||||||
@distributed_trace | ||||||||||||
def create_role_assignment(self, role_scope, role_assignment_name, role_definition_id, principal_id, **kwargs): | ||||||||||||
# type: (str, Union[str, UUID], str, str, **Any) -> KeyVaultRoleAssignment | ||||||||||||
# type: (Union[str, KeyVaultRoleScope], Union[str, UUID], str, str, **Any) -> KeyVaultRoleAssignment | ||||||||||||
"""Create a role assignment. | ||||||||||||
|
||||||||||||
:param str role_scope: scope the role assignment will apply over | ||||||||||||
:param role_scope: scope the role assignment will apply over. :class:`KeyVaultRoleScope` defines common broad | ||||||||||||
scopes. To list role definitions for a narrower scope, specify it as a string. | ||||||||||||
:type role_scope: str or KeyVaultRoleScope | ||||||||||||
:param role_assignment_name: a name for the role assignment. Must be a UUID. | ||||||||||||
:type role_assignment_name: str or uuid.UUID | ||||||||||||
:param str role_definition_id: ID of the role's definition | ||||||||||||
|
@@ -54,10 +57,13 @@ def create_role_assignment(self, role_scope, role_assignment_name, role_definiti | |||||||||||
|
||||||||||||
@distributed_trace | ||||||||||||
def delete_role_assignment(self, role_scope, role_assignment_name, **kwargs): | ||||||||||||
# type: (str, Union[str, UUID], **Any) -> KeyVaultRoleAssignment | ||||||||||||
# type: (Union[str, KeyVaultRoleScope], Union[str, UUID], **Any) -> KeyVaultRoleAssignment | ||||||||||||
"""Delete a role assignment. | ||||||||||||
|
||||||||||||
:param str role_scope: the assignment's scope, for example "/", "/keys", or "/keys/<specific key identifier>" | ||||||||||||
:param role_scope: the assignment's scope, for example "/", "/keys", or "/keys/<specific key identifier>" | ||||||||||||
:class:`KeyVaultRoleScope` defines common broad scopes. To list role definitions for a narrower scope, | ||||||||||||
specify it as a string. | ||||||||||||
:type role_scope: str or KeyVaultRoleScope | ||||||||||||
:param role_assignment_name: the assignment's name. Must be a UUID. | ||||||||||||
:type role_assignment_name: str or uuid.UUID | ||||||||||||
:returns: the deleted assignment | ||||||||||||
|
@@ -70,10 +76,13 @@ def delete_role_assignment(self, role_scope, role_assignment_name, **kwargs): | |||||||||||
|
||||||||||||
@distributed_trace | ||||||||||||
def get_role_assignment(self, role_scope, role_assignment_name, **kwargs): | ||||||||||||
# type: (str, Union[str, UUID], **Any) -> KeyVaultRoleAssignment | ||||||||||||
# type: (Union[str, KeyVaultRoleScope], Union[str, UUID], **Any) -> KeyVaultRoleAssignment | ||||||||||||
"""Get a role assignment. | ||||||||||||
|
||||||||||||
:param str role_scope: the assignment's scope, for example "/", "/keys", or "/keys/<specific key identifier>" | ||||||||||||
:param role_scope: the assignment's scope, for example "/", "/keys", or "/keys/<specific key identifier>" | ||||||||||||
:class:`KeyVaultRoleScope` defines common broad scopes. To list role definitions for a narrower scope, | ||||||||||||
specify it as a string. | ||||||||||||
|
:param role_scope: the assignment's scope, for example "/", "/keys", or "/keys/<specific key identifier>" | |
:class:`KeyVaultRoleScope` defines common broad scopes. To list role definitions for a narrower scope, | |
specify it as a string. | |
:param role_scope: the assignment's scope, for example "/", "/keys", or "/keys/<specific key identifier>" | |
:class:`KeyVaultRoleScope` defines common broad scopes. Specify a narrower scope as a string. |
Outdated
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.
Suggested change
:param role_scope: scope of the role assignments. :class:`KeyVaultRoleScope` defines common broad | |
scopes. To list role definitions for a narrower scope, specify it as a string. | |
:param role_scope: scope of the role assignments. :class:`KeyVaultRoleScope` defines common broad | |
scopes. To list role assignments for a narrower scope, specify it as a string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -14,6 +14,7 @@ | |||||||||
from typing import Any, Union | ||||||||||
from uuid import UUID | ||||||||||
from azure.core.async_paging import AsyncItemPaged | ||||||||||
from .._models import KeyVaultRoleScope | ||||||||||
|
||||||||||
|
||||||||||
class KeyVaultAccessControlClient(AsyncKeyVaultClientBase): | ||||||||||
|
@@ -29,15 +30,17 @@ class KeyVaultAccessControlClient(AsyncKeyVaultClientBase): | |||||||||
@distributed_trace_async | ||||||||||
async def create_role_assignment( | ||||||||||
self, | ||||||||||
role_scope: str, | ||||||||||
role_scope: "Union[str, KeyVaultRoleScope]", | ||||||||||
role_assignment_name: "Union[str, UUID]", | ||||||||||
role_definition_id: str, | ||||||||||
principal_id: str, | ||||||||||
**kwargs: "Any" | ||||||||||
) -> KeyVaultRoleAssignment: | ||||||||||
"""Create a role assignment. | ||||||||||
|
||||||||||
:param str role_scope: scope the role assignment will apply over | ||||||||||
:param role_scope: scope the role assignment will apply over. :class:`KeyVaultRoleScope` defines common broad | ||||||||||
scopes. To list role definitions for a narrower scope, specify it as a string. | ||||||||||
|
:param role_scope: scope the role assignment will apply over. :class:`KeyVaultRoleScope` defines common broad | |
scopes. To list role definitions for a narrower scope, specify it as a string. | |
:param role_scope: scope the role assignment will apply over. :class:`KeyVaultRoleScope` defines common broad | |
scopes. Specify a narrower scope as a string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.