Skip to content

Commit

Permalink
Fix: fix signedKey using platform id (#4634)
Browse files Browse the repository at this point in the history
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
  • Loading branch information
FogDong committed Aug 23, 2022
1 parent 1e87f45 commit ea20b6c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/apiserver/domain/model/system_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
// SystemInfo systemInfo model
type SystemInfo struct {
BaseModel
SignedKey string `json:"signedKey"`
InstallID string `json:"installID"`
EnableCollection bool `json:"enableCollection"`
StatisticInfo StatisticInfo `json:"statisticInfo,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion pkg/apiserver/domain/service/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ const (
GrantTypeRefresh = "refresh"
)

var signedKey = ""
// signedKey is the signed key of JWT
var signedKey string

// AuthenticationService is the service of authentication
type AuthenticationService interface {
Expand Down
3 changes: 2 additions & 1 deletion pkg/apiserver/domain/service/system_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (u systemInfoServiceImpl) Get(ctx context.Context) (*model.SystemInfo, erro
}
return info, nil
}
info.SignedKey = rand.String(32)
installID := rand.String(16)
info.InstallID = installID
info.EnableCollection = true
Expand Down Expand Up @@ -161,7 +162,7 @@ func (u systemInfoServiceImpl) Init(ctx context.Context) error {
if err != nil {
return err
}
signedKey = info.InstallID
signedKey = info.SignedKey
_, err = initDexConfig(ctx, u.KubeClient, "http://velaux.com")
return err
}
Expand Down

0 comments on commit ea20b6c

Please sign in to comment.