Repository navigation
Start up a new machine auth provider in the storage service - #2534
Conversation
d7ed5ed to
212b281
Compare
|
|
||
| res, err := c.authProvider.Authenticate(ctx, &gateway.AuthenticateRequest{ | ||
| Type: "machine", | ||
| Type: "bearer", |
There was a problem hiding this comment.
Why is that bearer now instead of machine but still using the machineAuthAPIKey?
There was a problem hiding this comment.
That's because machine is just a driver for bearer auth. https://github.com/owncloud/ocis/blob/master/storage/pkg/command/authbearer.go#L105-L117
And the auth registry recognizes only the bearer auth type https://github.com/owncloud/ocis/blob/master/storage/pkg/command/gateway.go#L157
I think we can somehow combine the bearer driver flag with the proxy backend one to make sure that we're only using machine in case the backend being used is cs3.
There was a problem hiding this comment.
I see. Don't we need to change the flagset value to machine then? In my current understanding it would break if we don't since the default driver of the bearer provider is oidc.
ocis/storage/pkg/flagset/authbearer.go
Line 25 in b98b39f
There was a problem hiding this comment.
Or maybe start another auth provider along with the existing basic and bearer providers for the machine authentication.
There was a problem hiding this comment.
Yes, both ideas sound good. I wouldn't want to change the default flag value but I can add a check
if PROXY_ACCOUNT_BACKEND_TYPE == "cs3" && STORAGE_AUTH_BEARER_DRIVER != "machine"
raise error
Or add a separate auth provider. Which one would you prefer?
There was a problem hiding this comment.
In my opinion a separate auth provider would be cleaner.
212b281 to
e7e0b48
Compare
4b05c45 to
375e912
Compare
|
Kudos, SonarCloud Quality Gate passed! |








No description provided.