-
Notifications
You must be signed in to change notification settings - Fork 494
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
ResourceToken support #622
ResourceToken support #622
Conversation
Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionCore.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/Resource/Settings/PermissionProperties.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/Resource/Settings/PermissionProperties.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosUserTests.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosUserTests.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosPermissionTests.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/Resource/Settings/PermissionProperties.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/RequestOptions/PermissionRequestOptions.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/RequestOptions/PermissionRequestOptions.cs
Outdated
Show resolved
Hide resolved
CosmosClient authKey rename -> authKeyOrResourceToken |
Create a backlog item for Fluent versions of these API's |
|
||
public override User GetUser(string id) | ||
{ | ||
if (string.IsNullOrEmpty(id)) |
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.
Would it be better to just use: this.ClientContext.ValidateResource(userProperties.Id);
{ | ||
this.Id = id; | ||
this.PermissionMode = permissionMode; | ||
this.ResourceUri = ((ContainerCore)container).LinkUri.OriginalString; |
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.
How can user UT this?
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.
Make LinkUri public on Container, but I thought we don't want to do that.
Please follow-up comments through issues. |
Description
Add Users and Permissions to the SDK. Constructor overload(s) to CosmosClient that supports multiple permissions/resource tokens is not included in this PR.
Because there is not SelfLinks or UriFactory like v2, constructor overloads were added to PermissionProperties which creates the ResourceLink from constructed LinkUri.
The resource token is a string just like account key and can be used as an alternative. I would like change the variable name in the signature but it would be a breaking change because it would break those that use named parameters. Also I can't create a second overload as it would be the same signature. I updated the constructor parameter documentation. I could always introduce a constructor overload for IEnumerable which will cover any user scenario and be more explicit.
Type of change
Please delete options that are not relevant.