Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions raystack/frontier/v1beta1/frontier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2852,14 +2852,12 @@ message CreateCurrentUserPATRequest {
(validate.rules).string.uuid = true,
(google.api.field_behavior) = REQUIRED
];
// Role ids to scope the PAT to
repeated string role_ids = 3 [
reserved 3, 4;
// Role-scope assignments for the PAT
repeated PATScope scopes = 7 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).repeated = {min_items: 1},
(validate.rules).repeated.items.string.uuid = true
(validate.rules).repeated = {min_items: 1}
];
// For project-scoped roles: empty = all projects, non-empty = specific projects
repeated string project_ids = 4 [(validate.rules).repeated.items.string.uuid = true];
google.protobuf.Timestamp expires_at = 5 [(google.api.field_behavior) = REQUIRED];
google.protobuf.Struct metadata = 6;
}
Expand Down Expand Up @@ -2918,14 +2916,12 @@ message UpdateCurrentUserPATRequest {
(validate.rules).string.min_len = 1,
(google.api.field_behavior) = REQUIRED
];
// Role ids to scope the PAT to
repeated string role_ids = 3 [
reserved 3, 4;
// Role-scope assignments for the PAT
repeated PATScope scopes = 6 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).repeated = {min_items: 1},
(validate.rules).repeated.items.string.uuid = true
(validate.rules).repeated = {min_items: 1}
];
// For project-scoped roles: empty = all projects, non-empty = specific projects
repeated string project_ids = 4 [(validate.rules).repeated.items.string.uuid = true];
google.protobuf.Struct metadata = 5;
}

Expand Down
18 changes: 16 additions & 2 deletions raystack/frontier/v1beta1/models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,20 @@ message ServiceUserToken {
google.protobuf.Timestamp created_at = 4;
}

// PATScope pairs a role with its resource type and optional resource IDs.
message PATScope {
string role_id = 1 [
(validate.rules).string.uuid = true,
(google.api.field_behavior) = REQUIRED
];
// Resource type: "app/organization" or "app/project"
string resource_type = 2 [
(google.api.field_behavior) = REQUIRED
];
// Specific resource UUIDs within the resource type (optional)
repeated string resource_ids = 3 [(validate.rules).repeated.items.string.uuid = true];
}

message PAT {
string id = 1;
string title = 2;
Expand All @@ -280,8 +294,8 @@ message PAT {
// this value is never persisted in the system so if lost, can't be recovered
string token = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

repeated string role_ids = 6;
repeated string project_ids = 7;
reserved 6, 7;
repeated PATScope scopes = 8;

google.protobuf.Timestamp expires_at = 10;
google.protobuf.Timestamp last_used_at = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand Down
Loading