Skip to content

Commit

Permalink
refactor: deprecating cookie and start sending token and expirations (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alsoba13 authored Oct 11, 2024
1 parent f74f58d commit 4f45c61
Show file tree
Hide file tree
Showing 7 changed files with 546 additions and 122 deletions.
263 changes: 171 additions & 92 deletions api/gen/proto/go/vcs/v1/vcs.pb.go

Large diffs are not rendered by default.

218 changes: 218 additions & 0 deletions api/gen/proto/go/vcs/v1/vcs_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 32 additions & 2 deletions api/openapiv2/gen/phlare.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1089,15 +1089,45 @@
"type": "object",
"properties": {
"cookie": {
"type": "string"
"type": "string",
"title": "Deprecated\nIn future version, this cookie won't be sent. Now, old cookie is sent alongside the new expected\ndata (token, token_expires_at and refresh_token_expires_at). Frontend will be responsible of computing\nits own cookie from the new data.\nRemove after completing https://github.com/grafana/explore-profiles/issues/187"
},
"token": {
"type": "string",
"title": "base64 encoded encrypted token"
},
"tokenExpiresAt": {
"type": "string",
"format": "int64",
"description": "Unix ms timestamp of when the token expires."
},
"refreshTokenExpiresAt": {
"type": "string",
"format": "int64",
"description": "Unix ms timestamp of when the refresh token expires."
}
}
},
"v1GithubRefreshResponse": {
"type": "object",
"properties": {
"cookie": {
"type": "string"
"type": "string",
"title": "Deprecated\nIn future version, this cookie won't be sent. Now, old cookie is sent alongside the new expected\ndata (token, token_expires_at and refresh_token_expires_at). Frontend will be responsible of computing\nits own cookie from the new data.\nRemove after completing https://github.com/grafana/explore-profiles/issues/187"
},
"token": {
"type": "string",
"title": "base64 encoded encrypted token"
},
"tokenExpiresAt": {
"type": "string",
"format": "int64",
"description": "Unix ms timestamp of when the token expires."
},
"refreshTokenExpiresAt": {
"type": "string",
"format": "int64",
"description": "Unix ms timestamp of when the refresh token expires."
}
}
},
Expand Down
22 changes: 22 additions & 0 deletions api/vcs/v1/vcs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,35 @@ message GithubLoginRequest {
}

message GithubLoginResponse {
// Deprecated
// In future version, this cookie won't be sent. Now, old cookie is sent alongside the new expected
// data (token, token_expires_at and refresh_token_expires_at). Frontend will be responsible of computing
// its own cookie from the new data.
// Remove after completing https://github.com/grafana/explore-profiles/issues/187
string cookie = 1;
// base64 encoded encrypted token
string token = 2;
// Unix ms timestamp of when the token expires.
int64 token_expires_at = 3;
// Unix ms timestamp of when the refresh token expires.
int64 refresh_token_expires_at = 4;
}

message GithubRefreshRequest {}

message GithubRefreshResponse {
// Deprecated
// In future version, this cookie won't be sent. Now, old cookie is sent alongside the new expected
// data (token, token_expires_at and refresh_token_expires_at). Frontend will be responsible of computing
// its own cookie from the new data.
// Remove after completing https://github.com/grafana/explore-profiles/issues/187
string cookie = 1;
// base64 encoded encrypted token
string token = 2;
// Unix ms timestamp of when the token expires.
int64 token_expires_at = 3;
// Unix ms timestamp of when the refresh token expires.
int64 refresh_token_expires_at = 4;
}

message GetFileRequest {
Expand Down
Loading

0 comments on commit 4f45c61

Please sign in to comment.