-
Notifications
You must be signed in to change notification settings - Fork 9
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
enable oauth clients on demand #57
Conversation
As a question: do we want to be backwards compatible? If not, I'd propose to have a unified view, like oauthClients:
pRMT:
enable: false
resource_ids: res_gateway,res_ManagementPortal
client_secret: ""
scope: MEASUREMENT.CREATE,SUBJECT.UPDATE,SUBJECT.READ,PROJECT.READ,SOURCETYPE.READ,SOURCE.READ,SOURCETYPE.READ,SOURCEDATA.READ,USER.READ,ROLE.READ
authorized_grant_types: refresh_token,authorization_code
redirect_uri: ""
authorities: ""
access_token_validity: 43200
refresh_token_validity: 7948800
additional_information: '{"dynamic_registration": true}'
autoapprove: "" etc... for other clients. Then the template would be something like client_id;resource_ids;client_secret;scope;authorized_grant_types;redirect_uri;authorities;access_token_validity;refresh_token_validity;additional_information;autoapprove
{{- range $clientId, $client := .Values.oauthClients -}}
{{- if $client.enable }}
{{ $clientId }};{{ $client.resource_ids }};{{ $client.client_secret }};{{ $client.scope }};{{ $client.authorized_grant_types }};{{ $client.redirect_uri | default "" }};{{ $client.authorities | default "" }};{{ $client.access_token_validity }};{{ $client. refresh_token_validity | default "0" }};{{ $client.additional_information | default "" }};{{ $client.autoapprove | default "" }}
{{- end -}}
{{- end -}} Then in values, you can easily enable existing clients with values oauthClients:
pRMT:
enable: true
secret: mySecret and add your own clients as well. |
I think we can do the change we suggested as well. It would be a bigger change though. I find current setup easier to maintain. Plus do we want to put the oauth client details of a specific component inside the chart ? |
The suggestions from Joris seem good to me and I think we can break backward compatibility here as we don't use this project in many installations yet. |
I am getting the error message below when I run
Any idea how to iterate through this custom model? oauthClients:
- enable: false
resource_ids: res_gateway,res_ManagementPortal
client_secret: ""
scope: MEASUREMENT.CREATE,SUBJECT.UPDATE,SUBJECT.READ,PROJECT.READ,SOURCETYPE.READ,SOURCE.READ,SOURCETYPE.READ,SOURCEDATA.READ,USER.READ,ROLE.READ
authorized_grant_types: refresh_token,authorization_code
redirect_uri: ""
authorities: ""
access_token_validity: 43200
refresh_token_validity: 7948800
additional_information: '{"dynamic_registration": true}'
autoapprove: "" @K1Hyve @blootsvoets Any thoughts? |
@nivemaham I think you should quote the |
Maybe because you're using an array instead of an object? It's complaining that it can't find your object ( |
@K1Hyve @nivemaham refactored the PR to have fully configurable OAuth 2.0 clients. Coul you please review? |
enable oauth clients on demand
enable oauth clients