-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Key Vault Admin] Convenience layer - KeyVaultAccessControlClient #10815
Changes from 11 commits
7c3cfc5
28b4eb6
eb9cbe0
a5524f5
167935d
44e9eb3
3790bd1
2188a87
60f4bd3
ac414c9
9e5505a
57fd102
0ce383e
7f179ef
8919a93
ee1d71e
b7d3bf5
26e9583
a10a592
09148fd
1b0f642
4513d72
6ab4ae1
7c845ca
9030441
18d7911
74b7bfc
ca12be4
e306ff4
d61f0b6
64a5d1d
1386365
590a835
23431cc
66bcdd4
8484177
24380a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
"mainEntryPointFilePath": "types/keyvault-admin/src/index.d.ts", | ||
"docModel": { | ||
"enabled": true | ||
}, | ||
"apiReport": { | ||
"enabled": true, | ||
"reportFolder": "./review" | ||
}, | ||
"dtsRollup": { | ||
"enabled": true, | ||
"untrimmedFilePath": "", | ||
"publicTrimmedFilePath": "./types/keyvault-admin.d.ts" | ||
}, | ||
"messages": { | ||
"tsdocMessageReporting": { | ||
"default": { | ||
"logLevel": "none" | ||
} | ||
}, | ||
"extractorMessageReporting": { | ||
"ae-missing-release-tag": { | ||
"logLevel": "none" | ||
}, | ||
"ae-unresolved-link": { | ||
"logLevel": "none" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
## API Report File for "@azure/keyvault-admin" | ||
|
||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
|
||
```ts | ||
|
||
import * as coreHttp from '@azure/core-http'; | ||
import { PagedAsyncIterableIterator } from '@azure/core-paging'; | ||
import { TokenCredential } from '@azure/core-http'; | ||
|
||
// @public (undocumented) | ||
export class AccessControlClient { | ||
constructor(vaultUrl: string, credential: TokenCredential, pipelineOptions?: AccessControlClientOptions); | ||
createRoleAssignment(scope: RoleAssignmentScope, name: string, options?: CreateRoleAssignmentOptions): Promise<KeyVaultRoleAssignment>; | ||
sadasant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
deleteRoleAssignment(scope: RoleAssignmentScope, name: string, options?: DeleteRoleAssignmentOptions): Promise<KeyVaultRoleAssignment>; | ||
getRoleAssignment(scope: RoleAssignmentScope, name: string, options?: DeleteRoleAssignmentOptions): Promise<KeyVaultRoleAssignment>; | ||
listRoleAssignments(scope: RoleAssignmentScope, options?: ListRoleAssignmentsOptions): PagedAsyncIterableIterator<KeyVaultRoleAssignment>; | ||
listRoleDefinitions(scope: RoleAssignmentScope, options?: ListRoleDefinitionsOptions): PagedAsyncIterableIterator<KeyVaultRoleDefinition>; | ||
readonly vaultUrl: string; | ||
} | ||
|
||
// @public | ||
export interface AccessControlClientOptions extends coreHttp.PipelineOptions { | ||
serviceVersion?: SUPPORTED_API_VERSIONS; | ||
} | ||
|
||
// @public | ||
export interface CreateRoleAssignmentOptions extends coreHttp.OperationOptions { | ||
properties?: RoleAssignmentProperties; | ||
} | ||
|
||
// @public | ||
export interface DeleteRoleAssignmentOptions extends coreHttp.OperationOptions { | ||
} | ||
|
||
// @public | ||
export interface KeyVaultRoleAssignment { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before I do this change, let's argue about prefixes here: #10815 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @heaths I'm assuming KeyVaultRoleAssignment is favored after that conversation I mentioned ^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. python has |
||
readonly id?: string; | ||
readonly name?: string; | ||
properties?: RoleAssignmentPropertiesWithScope; | ||
readonly type?: string; | ||
} | ||
|
||
// @public | ||
export interface KeyVaultRoleDefinition { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before I do this change, let's argue about prefixes here: #10815 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @heaths I'm assuming KeyVaultRoleDefinition is favored after that conversation I mentioned ^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. python has |
||
assignableScopes?: string[]; | ||
description?: string; | ||
readonly id?: string; | ||
readonly name?: string; | ||
permissions?: RoleDefinitionPermission[]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me! I'll do the changes you suggest for now to align to .Net and then we'll follow up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the KeyVault prefix exist on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same goes for RoleAssignment, should it be prefixed too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed the KeyVaultPermission part of this conversation here: 26e9583 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more consistency naming issue - java is using //cc: @vcolin7 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like the assignment part either! but otherwise I'll leave y'all to agree There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I prefer to have the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reading a bit more of the conversation above I think it's a good idea to use the prefix to for the sake of consistency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python here: Azure/azure-sdk-for-python#13372 seems to be using these as well: KeyVaultPermission This should go to Archboard review eventually, but I think we could keep things consistent together first. |
||
roleName?: string; | ||
roleType?: string; | ||
readonly type?: string; | ||
sadasant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
// @public | ||
export const LATEST_API_VERSION = "7.1"; | ||
|
||
// @public | ||
export interface ListRoleAssignmentsOptions extends coreHttp.OperationOptions { | ||
} | ||
|
||
// @public | ||
export interface ListRoleDefinitionsOptions extends coreHttp.OperationOptions { | ||
} | ||
|
||
// @public | ||
export interface RoleAssignmentProperties { | ||
principalId?: string; | ||
roleDefinitionId?: string; | ||
} | ||
|
||
// @public | ||
export interface RoleAssignmentPropertiesWithScope extends RoleAssignmentProperties { | ||
scope?: RoleAssignmentScope; | ||
} | ||
|
||
// @public | ||
export type RoleAssignmentScope = "/" | "/keys"; | ||
sadasant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// @public | ||
export interface RoleDefinitionPermission { | ||
actions?: string[]; | ||
dataActions?: string[]; | ||
notActions?: string[]; | ||
notDataActions?: string[]; | ||
} | ||
|
||
// @public | ||
export const SDK_VERSION: string; | ||
|
||
// @public | ||
export type SUPPORTED_API_VERSIONS = "7.0" | "7.1" | "7.2-preview"; | ||
sadasant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
// (No @packageDocumentation comment for this package) | ||
|
||
``` |
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.
Per discussion below, the principalId and roleDefinitionId (?) should be parameters. Same goes for any required parameters in other methods that follow.
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.
I have updated this by this point, to be:
Note that I used
roleDefinitionId
first, thenprincipalId
, since I believe that the former one has a smaller scope than the later one, so I'm trying to go from micro to macro, scope-wise. Does this make sense? I can change it, I won't push back, but this is my argument for my current approach.Wait, what other methods have these as the required parameters?
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 only methods that have these properties in .Net are: CreateRoleAssignment, and CreateRoleAssignmentAsync.