-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start up a new machine auth provider in the storage service #2534
Conversation
d7ed5ed
to
212b281
Compare
proxy/pkg/user/backend/cs3.go
Outdated
@@ -37,7 +37,7 @@ func (c *cs3backend) GetUserByClaims(ctx context.Context, claim, value string, w | |||
} | |||
|
|||
res, err := c.authProvider.Authenticate(ctx, &gateway.AuthenticateRequest{ | |||
Type: "machine", | |||
Type: "bearer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that bearer
now instead of machine
but still using the machineAuthAPIKey
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Value: flags.OverrideDefaultString(cfg.Reva.AuthBearerConfig.Driver, "oidc"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion a separate auth provider would be cleaner.
212b281
to
e7e0b48
Compare
4b05c45
to
375e912
Compare
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.