Skip to content

Commit

Permalink
fix(halalcloud): fix some custom fields not taking effect & update ap…
Browse files Browse the repository at this point in the history
…pID and appSecret (AlistGo#6938)
  • Loading branch information
Three-taile-dragon authored Aug 4, 2024
1 parent 2e4265a commit d4285b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions drivers/halalcloud/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ type Addition struct {
RefreshToken string `json:"refresh_token" required:"true" help:"login type is refresh_token,this is required"`
UploadThread string `json:"upload_thread" default:"3" help:"1 <= thread <= 32"`

AppID string `json:"app_id" required:"true" default:"devDebugger/1.0"`
AppID string `json:"app_id" required:"true" default:"alist/10001"`
AppVersion string `json:"app_version" required:"true" default:"1.0.0"`
AppSecret string `json:"app_secret" required:"true" default:"Nkx3Y2xvZ2luLmNu"`
AppSecret string `json:"app_secret" required:"true" default:"bR4SJwOkvnG5WvVJ"`
}

var config = driver.Config{
Expand Down
14 changes: 7 additions & 7 deletions drivers/halalcloud/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import (
)

const (
AppID = "devDebugger/1.0"
AppID = "alist/10001"
AppVersion = "1.0.0"
AppSecret = "Nkx3Y2xvZ2luLmNu"
AppSecret = "bR4SJwOkvnG5WvVJ"
)

const (
Expand Down Expand Up @@ -179,16 +179,16 @@ func (s *AuthService) signContext(method string, ctx context.Context) context.Co
bufferedString := bytes.NewBufferString(method)
kvString = append(kvString, "timestamp", currentTimeStamp)
bufferedString.WriteString(currentTimeStamp)
kvString = append(kvString, "appid", AppID)
bufferedString.WriteString(AppID)
kvString = append(kvString, "appversion", AppVersion)
bufferedString.WriteString(AppVersion)
kvString = append(kvString, "appid", s.appID)
bufferedString.WriteString(s.appID)
kvString = append(kvString, "appversion", s.appVersion)
bufferedString.WriteString(s.appVersion)
if s.tr != nil && len(s.tr.AccessToken) > 0 {
authorization := "Bearer " + s.tr.AccessToken
kvString = append(kvString, "authorization", authorization)
bufferedString.WriteString(authorization)
}
bufferedString.WriteString(AppSecret)
bufferedString.WriteString(s.appSecret)
sign := GetMD5Hash(bufferedString.String())
kvString = append(kvString, "sign", sign)
return metadata.AppendToOutgoingContext(ctx, kvString...)
Expand Down

0 comments on commit d4285b7

Please sign in to comment.