Skip to content
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

refactor: deprecating cookie and start sending token and expirations #3573

Merged
merged 1 commit into from
Oct 11, 2024
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
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's expand on why this is deprecated and possible link to some issues surrounding the deprecation decision. This includes the fact that for now cookie will still have the right value, but at some point in the future, we're going to release a version where cookie isn't used.

This isn't an API that we advertise as supported, so the audience isn't the general public, but rather us down the road.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same idea as the above comment.

// 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
Loading