mirror of
				https://github.com/zokradonh/kopano-docker
				synced 2025-10-31 10:27:14 +00:00 
			
		
		
		
	bugfix wrongly used variable name for writing identifier registration
add test for identifier scopes conf Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
		
							parent
							
								
									72ff6a4d51
								
							
						
					
					
						commit
						012d64d2bd
					
				| @ -25,6 +25,11 @@ tests: | |||||||
|     config: |     config: | ||||||
|       env: |       env: | ||||||
|         external_oidc_provider: yes |         external_oidc_provider: yes | ||||||
|  |   identifier scopes: | ||||||
|  |     command: /commander/test-helper.sh && wrapper.sh && yq . $identifier_scopes_conf | ||||||
|  |     stdout: | ||||||
|  |       contains: | ||||||
|  |         - '"description": "Access Kopano Meet"' | ||||||
| config: | config: | ||||||
|   env: |   env: | ||||||
|     PATH: ${PATH} |     PATH: ${PATH} | ||||||
|  | |||||||
| @ -32,14 +32,14 @@ if [ "${allow_client_guests:-}" = "yes" ]; then | |||||||
| 	#yq -y ".clients += [{\"id\": \"grapi-explorer.js\", \"name\": \"Grapi Explorer\", \"application_type\": \"web\", \"trusted\": true, \"insecure\": true, \"redirect_uris\": [\"http://$FQDNCLEANED:3000/\"]}]" $CONFIG_JSON | sponge $CONFIG_JSON | 	#yq -y ".clients += [{\"id\": \"grapi-explorer.js\", \"name\": \"Grapi Explorer\", \"application_type\": \"web\", \"trusted\": true, \"insecure\": true, \"redirect_uris\": [\"http://$FQDNCLEANED:3000/\"]}]" $CONFIG_JSON | sponge $CONFIG_JSON | ||||||
| 	yq -y ".clients += [{\"id\": \"kpop-https://$FQDN/meet/\", \"name\": \"Kopano Meet\", \"application_type\": \"web\", \"trusted\": true, \"redirect_uris\": [\"https://$FQDN/meet/\"], \"trusted_scopes\": [\"konnect/guestok\", \"kopano/kwm\"], \"jwks\": {\"keys\": [{\"kty\": $(jq .kty /tmp/jwk-meet.json), \"use\": $(jq .use /tmp/jwk-meet.json), \"crv\": $(jq .crv /tmp/jwk-meet.json), \"d\": $(jq .d /tmp/jwk-meet.json), \"kid\": $(jq .kid /tmp/jwk-meet.json), \"x\": $(jq .x /tmp/jwk-meet.json), \"y\": $(jq .y /tmp/jwk-meet.json)}]},\"request_object_signing_alg\": \"ES256\"}]" $CONFIG_JSON | sponge $CONFIG_JSON | 	yq -y ".clients += [{\"id\": \"kpop-https://$FQDN/meet/\", \"name\": \"Kopano Meet\", \"application_type\": \"web\", \"trusted\": true, \"redirect_uris\": [\"https://$FQDN/meet/\"], \"trusted_scopes\": [\"konnect/guestok\", \"kopano/kwm\"], \"jwks\": {\"keys\": [{\"kty\": $(jq .kty /tmp/jwk-meet.json), \"use\": $(jq .use /tmp/jwk-meet.json), \"crv\": $(jq .crv /tmp/jwk-meet.json), \"d\": $(jq .d /tmp/jwk-meet.json), \"kid\": $(jq .kid /tmp/jwk-meet.json), \"x\": $(jq .x /tmp/jwk-meet.json), \"y\": $(jq .y /tmp/jwk-meet.json)}]},\"request_object_signing_alg\": \"ES256\"}]" $CONFIG_JSON | sponge $CONFIG_JSON | ||||||
| 	# TODO this last bit can likely go (but then we must default to a registry stored below /etc/kopano) | 	# TODO this last bit can likely go (but then we must default to a registry stored below /etc/kopano) | ||||||
| 	yq -y . $CONFIG_JSON | sponge "${identifier_scopes_conf:?}" | 	yq -y . $CONFIG_JSON | sponge "${identifier_registration_conf:?}" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if [ "${external_oidc_provider:-}" = "yes" ]; then | if [ "${external_oidc_provider:-}" = "yes" ]; then | ||||||
| 	echo "Patching identifier registration for external OIDC provider" | 	echo "Patching identifier registration for external OIDC provider" | ||||||
| 	CONFIG_JSON=/etc/kopano/konnectd-identifier-registration.yaml | 	CONFIG_JSON=/etc/kopano/konnectd-identifier-registration.yaml | ||||||
| 	echo "authorities: [{name: ${external_oidc_name:-}, default: yes, iss: ${external_oidc_url:-}, client_id: kopano-meet, client_secret: ${external_oidc_clientsecret:-}, authority_type: oidc, response_type: id_token, scopes: [openid, profile, email]}]" >> $CONFIG_JSON | 	echo "authorities: [{name: ${external_oidc_name:-}, default: yes, iss: ${external_oidc_url:-}, client_id: kopano-meet, client_secret: ${external_oidc_clientsecret:-}, authority_type: oidc, response_type: id_token, scopes: [openid, profile, email]}]" >> $CONFIG_JSON | ||||||
| 	yq -y . $CONFIG_JSON | sponge "${identifier_scopes_conf:?}" | 	yq -y . $CONFIG_JSON | sponge "${identifier_registration_conf:?}" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| # source additional configuration from Konnect cfg (potentially overwrites env vars) | # source additional configuration from Konnect cfg (potentially overwrites env vars) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user