Skip to content

Commit d14c82a

Browse files
easyCZroboquat
authored andcommitted
[public-api] Remove hash property from Personal Access Token
1 parent 72de793 commit d14c82a

File tree

4 files changed

+156
-188
lines changed

4 files changed

+156
-188
lines changed

components/public-api-server/pkg/apiv1/tokens.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ func personalAccessTokenToAPI(t db.PersonalAccessToken, value string) *v1.Person
274274
Id: t.ID.String(),
275275
// value is only present when the token is first created, or regenerated. It's empty for all subsequent requests.
276276
Value: value,
277-
Hash: t.Hash,
278277
Name: t.Name,
279278
Description: t.Description,
280279
Scopes: t.Scopes,

components/public-api/gitpod/experimental/v1/tokens.proto

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,26 @@ message PersonalAccessToken {
1616

1717
// value is the secret value of the token
1818
// The value property is only populated when the PersonalAccessToken is first created, and never again.
19-
// If you you want to compare your existing token, use the hash property
2019
// Read only.
2120
string value = 2;
2221

23-
// hash is the SHA-512 hash of the token value
24-
// You can use the hash to compare a token you hold against the one we keep on record by doing `echo -n $TOKEN | sha256sum`.
25-
// Read only.
26-
string hash = 3;
27-
2822
// name is the name of the token for humans, set by the user
29-
string name = 4;
23+
string name = 3;
3024

3125
// description is the description of the token set by the user
32-
string description = 5;
26+
string description = 4;
3327

3428
// expiration_time is the time when the token expires
3529
// Read only.
36-
google.protobuf.Timestamp expiration_time = 6;
30+
google.protobuf.Timestamp expiration_time = 5;
3731

3832
// scopes are the permission scopes attached to this token.
3933
// By default, no scopes are attached and therefore no access is granted to this token.
4034
// Specifying '*' grants all permissions the owner of the token has.
41-
repeated string scopes = 7;
35+
repeated string scopes = 6;
4236

4337
// created_time is the time when the token was first created.
44-
google.protobuf.Timestamp created_at = 8;
38+
google.protobuf.Timestamp created_at = 7;
4539
}
4640

4741
service TokensService {

0 commit comments

Comments
 (0)