Skip to content

Commit da218b4

Browse files
committed
refactor: update PersonalAccessToken RPC
1 parent 5f5beca commit da218b4

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

raystack/frontier/v1beta1/frontier.proto

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,23 +4261,24 @@ message CreateAuditRecordResponse {
42614261
}
42624262

42634263
message CreateCurrentUserPersonalTokenRequest {
4264-
// Machine-friendly identifier, unique per user per org
4265-
string name = 1 [
4264+
// Human-friendly display name, unique per user per org
4265+
string title = 1 [
42664266
(validate.rules).string.min_len = 1,
42674267
(google.api.field_behavior) = REQUIRED
42684268
];
4269-
// Human-friendly display name
4270-
string title = 2;
4271-
string org_id = 3 [
4269+
string org_id = 2 [
42724270
(validate.rules).string.uuid = true,
42734271
(google.api.field_behavior) = REQUIRED
42744272
];
42754273
// Roles to scope the token to (e.g., ["app_organization_manager", "app_project_owner"])
4276-
repeated string roles = 4 [(google.api.field_behavior) = REQUIRED];
4274+
repeated string roles = 3 [
4275+
(google.api.field_behavior) = REQUIRED,
4276+
(validate.rules).repeated = {min_items: 1}
4277+
];
42774278
// For project-scoped roles: empty = all projects, non-empty = specific projects
4278-
repeated string project_ids = 5;
4279-
google.protobuf.Timestamp expires_at = 6 [(google.api.field_behavior) = REQUIRED];
4280-
google.protobuf.Struct metadata = 7;
4279+
repeated string project_ids = 4 [(validate.rules).repeated.items.string.uuid = true];
4280+
google.protobuf.Timestamp expires_at = 5 [(google.api.field_behavior) = REQUIRED];
4281+
google.protobuf.Struct metadata = 6;
42814282
}
42824283

42834284
message CreateCurrentUserPersonalTokenResponse {

raystack/frontier/v1beta1/models.proto

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -441,29 +441,28 @@ message ServiceUserToken {
441441

442442
message PersonalAccessToken {
443443
string id = 1;
444-
string name = 2;
445-
string title = 3;
444+
string title = 2;
446445

447446
// token will only be returned once as part of the create process
448447
// this value is never persisted in the system so if lost, can't be recovered
449-
string token = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
448+
string token = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
450449

451-
google.protobuf.Struct metadata = 5;
452-
453-
google.protobuf.Timestamp expires_at = 6 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
450+
google.protobuf.Timestamp expires_at = 10 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
454451
description: "The time when the token expires.",
455452
example: "\"2024-06-07T05:39:56.961Z\""
456453
}];
457454

458-
google.protobuf.Timestamp last_used_at = 7 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
455+
google.protobuf.Timestamp last_used_at = 11 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
459456
description: "The time when the token was last used.",
460457
example: "\"2024-06-07T05:39:56.961Z\""
461458
}];
462459

463-
google.protobuf.Timestamp created_at = 8 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
460+
google.protobuf.Timestamp created_at = 12 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
464461
description: "The time when the token was created.",
465462
example: "\"2023-06-07T05:39:56.961Z\""
466463
}];
464+
465+
google.protobuf.Struct metadata = 20;
467466
}
468467

469468
// JSON Web Key as specified in RFC 7517

0 commit comments

Comments
 (0)