Skip to content

Commit

Permalink
chore: rename GitSession to pyroscope_git_session (#3542)
Browse files Browse the repository at this point in the history
  • Loading branch information
alsoba13 authored Sep 20, 2024
1 parent 05e2edd commit 40c5cc5
Show file tree
Hide file tree
Showing 27 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ datasources:
name: Pyroscope
url: http://pyroscope:4040
jsonData:
keepCookies: [GitSession]
keepCookies: [pyroscope_git_session]
# Uncomment these if using with Grafana Cloud
# basicAuth: true
# basicAuthUser: '123456'
Expand Down
2 changes: 1 addition & 1 deletion pkg/embedded/grafana/grafana.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (a *app) provisioningDatasource(_ context.Context) error {
"name": "Pyroscope",
"url": a.cfg.PyroscopeURL,
"jsonData": map[string]interface{}{
"keepCookies": []string{"GitSession"},
"keepCookies": []string{"pyroscope_git_session"},
"overridesDefault": true,
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/vcs/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
)

const (
sessionCookieName = "GitSession"
sessionCookieName = "pyroscope_git_session"
)

type gitSessionTokenCookie struct {
Expand Down
6 changes: 3 additions & 3 deletions pkg/querier/vcs/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func Test_tokenFromRequest(t *testing.T) {

t.Run("token does not exist in request", func(t *testing.T) {
githubSessionSecret = []byte("16_byte_key_XXXX")
wantErr := "failed to read cookie GitSession: http: named cookie not present"
wantErr := "failed to read cookie pyroscope_git_session: http: named cookie not present"

// The type of request here doesn't matter.
req := connect.NewRequest(&vcsv1.GetFileRequest{})
Expand Down Expand Up @@ -275,12 +275,12 @@ func Test_tenantIsolation(t *testing.T) {

}

func Test_StillCompatbile(t *testing.T) {
func Test_StillCompatible(t *testing.T) {
githubSessionSecret = []byte("16_byte_key_XXXX")

ctx := newTestContextWithTenantID("tenant_a")
req := connect.NewRequest(&vcsv1.GetFileRequest{})
req.Header().Add("Cookie", "GitSession=eyJtZXRhZGF0YSI6Im12N0d1OHlIanZxdWdQMmF5TnJaYXd1SXNyQXFmUUVIMVhGS1RkejVlZWtob1NRV1JUM3hVZGRuMndUemhQZ05oWktRVkpjcVh5SVJDSnFmTTV3WTJyNmR3R21rZkRhL2FORjhRZ0lJcU1oa1hPbGFEdXNwcFE9PSJ9Cg==")
req.Header().Add("Cookie", "pyroscope_git_session=eyJtZXRhZGF0YSI6Im12N0d1OHlIanZxdWdQMmF5TnJaYXd1SXNyQXFmUUVIMVhGS1RkejVlZWtob1NRV1JUM3hVZGRuMndUemhQZ05oWktRVkpjcVh5SVJDSnFmTTV3WTJyNmR3R21rZkRhL2FORjhRZ0lJcU1oa1hPbGFEdXNwcFE9PSJ9Cg==")

realToken, err := tokenFromRequest(ctx, req)
require.NoError(t, err)
Expand Down

0 comments on commit 40c5cc5

Please sign in to comment.