Fixes Auth Issue (#2064)
This commit is contained in:
parent
5a4ff2c855
commit
8912d7149c
@ -499,8 +499,9 @@ func (planet *Planet) newSatellites(count int) ([]*satellite.Peer, error) {
|
||||
AuthType: "simulate",
|
||||
},
|
||||
Console: consoleweb.Config{
|
||||
Address: "127.0.0.1:0",
|
||||
PasswordCost: console.TestPasswordCost,
|
||||
Address: "127.0.0.1:0",
|
||||
PasswordCost: console.TestPasswordCost,
|
||||
AuthTokenSecret: "my-suppa-secret-key",
|
||||
},
|
||||
Version: planet.NewVersionConfig(),
|
||||
}
|
||||
|
@ -47,7 +47,8 @@ type Config struct {
|
||||
ExternalAddress string `help:"external endpoint of the satellite if hosted" default:""`
|
||||
|
||||
// TODO: remove after Vanguard release
|
||||
AuthToken string `help:"auth token needed for access to registration token creation endpoint" default:""`
|
||||
AuthToken string `help:"auth token needed for access to registration token creation endpoint" default:""`
|
||||
AuthTokenSecret string `help:"secret used to sign auth tokens" releaseDefault:"" devDefault:"my-suppa-secret-key"`
|
||||
|
||||
PasswordCost int `internal:"true" help:"password hashing cost (0=automatic)" default:"0"`
|
||||
}
|
||||
|
@ -512,10 +512,13 @@ func New(log *zap.Logger, full *identity.FullIdentity, db DB, config *Config, ve
|
||||
return nil, errs.Combine(err, peer.Close())
|
||||
}
|
||||
|
||||
if consoleConfig.AuthTokenSecret == "" {
|
||||
return nil, errs.New("Auth token secret required")
|
||||
}
|
||||
|
||||
peer.Console.Service, err = console.NewService(
|
||||
peer.Log.Named("console:service"),
|
||||
// TODO(yar): use satellite key
|
||||
&consoleauth.Hmac{Secret: []byte("my-suppa-secret-key")},
|
||||
&consoleauth.Hmac{Secret: []byte(consoleConfig.AuthTokenSecret)},
|
||||
peer.DB.Console(),
|
||||
consoleConfig.PasswordCost,
|
||||
)
|
||||
|
3
scripts/testdata/satellite-config.yaml.lock
vendored
3
scripts/testdata/satellite-config.yaml.lock
vendored
@ -16,6 +16,9 @@
|
||||
# auth token needed for access to registration token creation endpoint
|
||||
# console.auth-token: ""
|
||||
|
||||
# secret used to sign auth tokens
|
||||
# console.auth-token-secret: ""
|
||||
|
||||
# external endpoint of the satellite if hosted
|
||||
# console.external-address: ""
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user