mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-28 02:55:30 -05:00
Derive the guest session key from OC_JWT_SECRET
Replace AUTH_GUEST_SESSION_JWT_SECRET with a key derived via HMAC-SHA256 from the reva JWT secret. Guest session tokens and reva access tokens remain unforgeable across each other without a second secret to configure.
This commit is contained in:
1 parent
1df2eb21d4
commit
10b93edded
9 files changed
+58
-47
No files matched your search
@@ -69,7 +69,6 @@ func CreateConfig(insecure, forceOverwrite, diff bool, configPath, adminPassword
|
||||
idmServicePassword, idpServicePassword, ocAdminServicePassword, revaServicePassword string
|
||||
tokenManagerJwtSecret, collaborationWOPISecret, machineAuthAPIKey, systemUserAPIKey string
|
||||
revaTransferSecret, thumbnailsTransferSecret, serviceAccountSecret, urlSigningSecret string
|
||||
authGuestJWTSecret string
|
||||
adminPasswdwordGenerated bool
|
||||
)
|
||||
|
||||
@@ -104,13 +103,6 @@ func CreateConfig(insecure, forceOverwrite, diff bool, configPath, adminPassword
|
||||
return fmt.Errorf("could not generate random secret for urlSigningSecret: %s", err)
|
||||
}
|
||||
}
|
||||
authGuestJWTSecret = oldCfg.AuthGuest.JWT.Secret
|
||||
if authGuestJWTSecret == "" {
|
||||
authGuestJWTSecret, err = generators.GenerateRandomPassword(passwordLength)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not generate random secret for authGuestJWTSecret: %s", err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
systemUserID = uuid.NewString()
|
||||
adminUserID = uuid.NewString()
|
||||
@@ -163,10 +155,6 @@ func CreateConfig(insecure, forceOverwrite, diff bool, configPath, adminPassword
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not generate random secret for urlSigningSecret: %s", err)
|
||||
}
|
||||
authGuestJWTSecret, err = generators.GenerateRandomPassword(passwordLength)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not generate random secret for authGuestJWTSecret: %s", err)
|
||||
}
|
||||
thumbnailsTransferSecret, err = generators.GenerateRandomPassword(passwordLength)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not generate random password for thumbnailsTransferSecret: %s", err)
|
||||
@@ -226,7 +214,6 @@ func CreateConfig(insecure, forceOverwrite, diff bool, configPath, adminPassword
|
||||
},
|
||||
AuthGuest: AuthGuest{
|
||||
ServiceAccount: serviceAccount,
|
||||
JWT: AuthGuestJWT{Secret: authGuestJWTSecret},
|
||||
},
|
||||
Users: UsersAndGroupsService{
|
||||
Drivers: LdapBasedService{
|
||||
|
||||
@@ -57,12 +57,6 @@ type Activitylog struct {
|
||||
// AuthGuest is the configuration for the auth-guest service
|
||||
type AuthGuest struct {
|
||||
ServiceAccount ServiceAccount `yaml:"service_account"`
|
||||
JWT AuthGuestJWT `yaml:"jwt"`
|
||||
}
|
||||
|
||||
// AuthGuestJWT is the configuration for the guest session tokens
|
||||
type AuthGuestJWT struct {
|
||||
Secret string `yaml:"secret"`
|
||||
}
|
||||
|
||||
// App is the configuration for the collaboration service
|
||||
|
||||
Reference in new issue
Block a user