mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-20 04:29:24 -06:00
Use machine auth when using cs3 backend in proxy service
This commit is contained in:
@@ -31,14 +31,9 @@ func NewCS3UserBackend(rs settings.RoleService, ap RevaAuthenticator, machineAut
|
||||
}
|
||||
|
||||
func (c *cs3backend) GetUserByClaims(ctx context.Context, claim, value string, withRoles bool) (*cs3.User, string, error) {
|
||||
// We only support authentication via username for now
|
||||
if claim != "username" {
|
||||
return nil, "", fmt.Errorf("claim: %s not supported", claim)
|
||||
}
|
||||
|
||||
res, err := c.authProvider.Authenticate(ctx, &gateway.AuthenticateRequest{
|
||||
Type: "bearer",
|
||||
ClientId: value,
|
||||
Type: "machine",
|
||||
ClientId: claim + ":" + value,
|
||||
ClientSecret: c.machineAuthAPIKey,
|
||||
})
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@ func gatewayConfigFromStruct(c *cli.Context, cfg *config.Config, logger log.Logg
|
||||
"rules": map[string]interface{}{
|
||||
"basic": cfg.Reva.AuthBasic.Endpoint,
|
||||
"bearer": cfg.Reva.AuthBearer.Endpoint,
|
||||
"machine": cfg.Reva.AuthMachine.Endpoint,
|
||||
"publicshares": cfg.Reva.StoragePublicLink.Endpoint,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user