singularityhub / sregistry

server for storage and management of singularity images
https://singularityhub.github.io/sregistry
Mozilla Public License 2.0
103 stars 42 forks source link

hard coding SOCIAL_AUTH_GITLAB_SCOPE breaks auth. #434

Closed karcaw closed 1 year ago

karcaw commented 1 year ago

In the settings file if gitlab is enabled, the code just forces SOCIAL_AUTH_GITLAB_SCOPE to be api and read_user scopes.

https://github.com/singularityhub/sregistry/blob/ee23901a00a23d0d2a65fab5f484c803cfd60e44/shub/settings.py#L671

This seems to break my auth, as the social auth adds read_user onto the end of what is asked for, effectively causing a duplicate in the scopes that are handed to gitlab. This seems to break gitlab auth with a The requested scope is invalid, unknown, or malformed. message

I also don't need the api scope just for auth, and there is no way to provide an override setting since the code just sets it as the last thing.

My suggestion is to: make the default [], and provide a way to set it from the environment or the settings.yaml file.

Discuss...

vsoch commented 1 year ago

That would work for me.