Skip to content

feat(oauth): Oauth2 proxy for swagger UI docs page #959

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

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ZohebShaikh
Copy link
Contributor

No description provided.

@ZohebShaikh ZohebShaikh changed the title Ouath2 proxy feat(auth): Oauth2 proxy for swagger UI docs page May 28, 2025
@ZohebShaikh ZohebShaikh changed the title feat(auth): Oauth2 proxy for swagger UI docs page feat(oauth): Oauth2 proxy for swagger UI docs page May 28, 2025
Comment on lines 134 to 141
ingress:
enabled: true
hosts:
- p46-blueapi.diamond.ac.uk
annotations:
nginx.ingress.kubernetes.io/proxy-buffer-size: "8k"
path: /
pathType: Prefix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ingress:
enabled: true
hosts:
- p46-blueapi.diamond.ac.uk
annotations:
nginx.ingress.kubernetes.io/proxy-buffer-size: "8k"
path: /
pathType: Prefix
ingress:
path: /
pathType: Prefix

Comment on lines 127 to 129
oidc:
well_known_url: https://authn.diamond.ac.uk/realms/master/.well-known/openid-configuration
client_id: blueapi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
oidc:
well_known_url: https://authn.diamond.ac.uk/realms/master/.well-known/openid-configuration
client_id: blueapi
# oidc:
# well_known_url: https://authn.diamond.ac.uk/realms/master/.well-known/openid-configuration
# client_id: blueapi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then add documentation on how to enable authentication, i.e. enable this and add

oauth2-proxy:
  ingress:
    enabled: true
    hosts:
      - p46-blueapi.diamond.ac.uk

to your config

And provide a SealedSecret with the client-secret?

clientID: blueapi
clientSecret:
oidcConfig:
insecureSkipNonce: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you decide you didn't need this?

skip_provider_button = true
silence_ping_logging=true
cookie_refresh="1m"
cookie_expire="30m"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cookie_expire="30m"
cookie_expire="30m"
upstreams = [ "{{ include "blueapi.fullname" . }}:{{ .Values.service.port }}" ]

Comment on lines 156 to 159
upstreams:
- id: blueapi
path: /
uri: http://blueapi.p46-beamline:80
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
upstreams:
- id: blueapi
path: /
uri: http://blueapi.p46-beamline:80

Comment on lines +115 to +117
app.swagger_ui_init_oauth = {
"clientId": "NOT_SUPPORTED",
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the standard way to disable this? Can't we just not generate that part of the UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generated from the openapi Yaml spec ...I will need to remove the security from them to remove the pad locks ...
I can do that but I don't think it is a good idea to change the openapi yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants