-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add CreateCurrentUserPAT RPC #443
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
base: main
Are you sure you want to change the base?
Changes from all commits
5f5beca
da218b4
bed408e
08620d9
9eb3b9a
564f969
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 | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -439,6 +439,48 @@ message ServiceUserToken { | |||||||||||||||||||||||
| }]; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| message PAT { | ||||||||||||||||||||||||
| string id = 1; | ||||||||||||||||||||||||
| string title = 2; | ||||||||||||||||||||||||
| string user_id = 3; | ||||||||||||||||||||||||
| string org_id = 4; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // token will only be returned once as part of the create process | ||||||||||||||||||||||||
| // this value is never persisted in the system so if lost, can't be recovered | ||||||||||||||||||||||||
| string token = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| google.protobuf.Timestamp expires_at = 10 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||||||||||||||||||||||||
| description: "The time when the PAT expires.", | ||||||||||||||||||||||||
| example: "\"2024-06-07T05:39:56.961Z\"" | ||||||||||||||||||||||||
| }]; | ||||||||||||||||||||||||
|
Comment on lines
452
to
455
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.
🛡️ Proposed fix- google.protobuf.Timestamp expires_at = 10 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
- description: "The time when the token expires.",
- example: "\"2024-06-07T05:39:56.961Z\""
- }];
+ google.protobuf.Timestamp expires_at = 10 [
+ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
+ description: "The time when the token expires.",
+ example: "\"2024-06-07T05:39:56.961Z\""
+ },
+ (google.api.field_behavior) = OUTPUT_ONLY
+ ];📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| google.protobuf.Timestamp last_used_at = 11 [ | ||||||||||||||||||||||||
| (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||||||||||||||||||||||||
| description: "The time when the PAT was last used.", | ||||||||||||||||||||||||
| example: "\"2024-06-07T05:39:56.961Z\"" | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| (google.api.field_behavior) = OUTPUT_ONLY | ||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| google.protobuf.Timestamp created_at = 12 [ | ||||||||||||||||||||||||
| (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||||||||||||||||||||||||
| description: "The time when the PAT was created.", | ||||||||||||||||||||||||
| example: "\"2023-06-07T05:39:56.961Z\"" | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| (google.api.field_behavior) = OUTPUT_ONLY | ||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| google.protobuf.Timestamp updated_at = 13 [ | ||||||||||||||||||||||||
| (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||||||||||||||||||||||||
| description: "The time when the PAT was last updated.", | ||||||||||||||||||||||||
| example: "\"2023-06-07T05:39:56.961Z\"" | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| (google.api.field_behavior) = OUTPUT_ONLY | ||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| google.protobuf.Struct metadata = 20; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // JSON Web Key as specified in RFC 7517 | ||||||||||||||||||||||||
| message JSONWebKey { | ||||||||||||||||||||||||
| // Key Type. | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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.
user_idshould carryOUTPUT_ONLYuser_idis not present inCreateCurrentUserPersonalTokenRequest— it is derived from the authenticated session server-side. WithoutOUTPUT_ONLY, code generators and client libraries may incorrectly treat it as a writable field.🛡️ Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents