Skip to content

Commit

Permalink
chore: add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Apr 15, 2024
1 parent 7ed696c commit 3093d21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/ramauthenticator/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

const (
tokenPrefixV1 = "k8s-ack-v2." // #nosec G101
tokenPrefixV2 = "k8s-ack-v2." // #nosec G101
)

var tokenExpiration = time.Minute * 15 // #nosec G101
Expand All @@ -35,8 +35,8 @@ var signParamsWhitelist = map[string]bool{
type Token struct {
ClusterId string `json:"clusterId"`

Method string `json:"method"`
Path string `json:"path"`
Method string `json:"method"` // for audit
Path string `json:"path"` // for audit
Query map[string]string `json:"query"`
Headers map[string]string `json:"headers"`

Expand Down Expand Up @@ -94,7 +94,7 @@ func GenerateToken(clusterId string, cred credentials.Credential) (*Token, error

func (t *Token) String() string {
req, _ := json.Marshal(t)
return tokenPrefixV1 + base64.StdEncoding.EncodeToString(req)
return tokenPrefixV2 + base64.StdEncoding.EncodeToString(req)
}

func generatePreSignedReq(request *openapi.OpenApiRequest, params *openapi.Params, cred credentials.Credential) (*tea.Request, error) {
Expand Down

0 comments on commit 3093d21

Please sign in to comment.