-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: update global admin for member role changes #304
Merged
Merged
Changes from all 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 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 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 |
---|---|---|
@@ -0,0 +1,199 @@ | ||
syntax = "proto3"; | ||
|
||
option go_package = "github.com/momentohq/client-sdk-go;client_sdk_go"; | ||
option java_multiple_files = true; | ||
option java_package = "grpc.permission_rules"; | ||
option csharp_namespace = "Momento.Protos.PermissionRules"; | ||
|
||
package permission_rules; | ||
|
||
// This is "Version 2" of permissions in Momento. | ||
|
||
// Some general terminology (exceptions to be noted) | ||
// Read = "access a specific resource without modification" | ||
// List = "access a unspecified set of resources without modification" List is separated from read many. List actions | ||
// cannot predetermine which resources will be accessed. List is always total - it cannot be restricted by a resource | ||
// selector. | ||
// Write = "access a resource or resources with modification" | ||
|
||
// Used for generic "everything" resource selectors. | ||
message All {} | ||
|
||
// Permissions related to global account management APIs | ||
enum AccountManagementPermissions { | ||
// Can only read account information | ||
AccountRead = 0; | ||
// Can take management actions | ||
AccountWrite = 1; | ||
// Can list accounts | ||
AccountList = 2; | ||
} | ||
|
||
// Permissions related to managing authentication resources. | ||
enum AuthManagementPermissions { | ||
// Can only read auth keys/roles metadata. Read does not allow retrieving secrets - that is considered "modification" | ||
AuthRead = 0; | ||
// Can create and manage auth keys/roles | ||
AuthWrite = 1; | ||
// Can list auth keys/roles metadata. List does not allow retrieving secrets - that is considered "modification" | ||
AuthList = 2; | ||
} | ||
|
||
// Permissions related to managing Momento resources (Caches, Stores, Webhooks, etc.) | ||
enum ResourceManagementPermissions { | ||
// Can only read resources | ||
ResourceRead = 0; | ||
// Can create/manage resources | ||
ResourceWrite = 1; | ||
// Can list resources | ||
ResourceList = 2; | ||
} | ||
|
||
enum CacheAPIPermissions { | ||
// Does not apply to individual resources | ||
CacheList = 0; | ||
// Restricts access to apis that read data from caches: No higher level resource description or modification. | ||
CacheRead = 1; | ||
// Restricts access to apis that write to caches: No higher level resource description or modification. | ||
CacheWrite = 2; | ||
} | ||
|
||
// Allows specifying specific caches. | ||
message CacheSelector { | ||
oneof kind { | ||
string cache_name = 1; | ||
} | ||
} | ||
|
||
// Allows specifying specific items within caches. | ||
message CacheItemSelector { | ||
oneof kind { | ||
bytes key = 1; | ||
bytes key_prefix = 2; | ||
} | ||
} | ||
|
||
enum StoreAPIPermissions { | ||
// Does not apply to individual resources | ||
StoreList = 0; | ||
// Restricts access to apis that read data from stores: No higher level resource description or modification. | ||
StoreRead = 1; | ||
// Restricts access to apis that write to stores: No higher level resource description or modification. | ||
StoreWrite = 2; | ||
} | ||
|
||
// Allows specifying specific stores. | ||
message StoreSelector { | ||
oneof kind { | ||
string store_name = 1; | ||
} | ||
} | ||
|
||
// Allows specifying specific items within stores. | ||
message StoreItemSelector { | ||
oneof kind { | ||
bytes key = 1; | ||
bytes key_prefix = 2; | ||
} | ||
} | ||
|
||
// Topic API Restrictions | ||
enum TopicAPIPermissions { | ||
// Does not apply to individual resources | ||
TopicList = 0; | ||
// Restricts access to apis that read data from topics: No higher level resource description or modification. | ||
TopicRead = 1; | ||
// Restricts access to apis that write to topics: No higher level resource description or modification. | ||
TopicWrite = 2; | ||
} | ||
|
||
// Allows specifying specific topics within caches. | ||
message TopicSelector { | ||
oneof kind { | ||
string topic_name = 1; | ||
string topic_name_prefix = 2; | ||
} | ||
} | ||
|
||
message PermissionSet { | ||
oneof kind { | ||
SuperUserPermissions super_user = 1; | ||
ExplicitPermissions explicit = 2; | ||
} | ||
} | ||
|
||
enum SuperUserPermissions { | ||
SuperUser = 0; | ||
} | ||
|
||
message ExplicitPermissions { | ||
repeated Rule rules = 1; | ||
} | ||
|
||
message Rule { | ||
oneof kind { | ||
AccountManagementRule account_management_rule = 1; | ||
AuthManagementRule auth_management_rule = 2; | ||
ResourceManagementRule resource_management_rule = 3; | ||
CacheRule cache_rule = 4; | ||
TopicRule topic_rule = 5; | ||
StoreRule storage_rule = 6; | ||
} | ||
|
||
message AccountManagementRule { | ||
repeated AccountManagementPermissions permissions = 1; | ||
// No resource selectors here - permissions are inherently account-scoped. | ||
} | ||
|
||
message AuthManagementRule { | ||
repeated AuthManagementPermissions permissions = 1; | ||
// No fine-grained resource control yet. | ||
oneof auth_items { | ||
All all_items = 2; | ||
} | ||
} | ||
|
||
message ResourceManagementRule { | ||
repeated ResourceManagementPermissions permissions = 1; | ||
// No fine-grained resource control yet. | ||
oneof resources { | ||
All all_resources = 2; | ||
} | ||
} | ||
|
||
message CacheRule { | ||
repeated CacheAPIPermissions permissions = 1; | ||
oneof cache { | ||
All all_caches = 2; | ||
CacheSelector cache_selector = 3; | ||
} | ||
oneof cache_item { | ||
All all_items = 4; | ||
CacheItemSelector item_selector = 5; | ||
} | ||
} | ||
|
||
message TopicRule { | ||
repeated TopicAPIPermissions permissions = 1; | ||
oneof cache { | ||
All all_caches = 2; | ||
CacheSelector cache_selector = 3; | ||
} | ||
oneof topic { | ||
All all_topics = 4; | ||
TopicSelector topic_selector = 5; | ||
} | ||
} | ||
|
||
message StoreRule { | ||
repeated StoreAPIPermissions permissions = 1; | ||
oneof store { | ||
All all_stores = 2; | ||
StoreSelector store_selector = 3; | ||
} | ||
oneof store_item { | ||
All all_items = 4; | ||
StoreItemSelector item_selector = 5; | ||
} | ||
} | ||
} |
Oops, something went wrong.
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.
do you want to remove these fields that have TODO: deprecate tag? it can be done later as well
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'd prefer to just remove them later I think.
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.
sounds good!