Switch Koschei web auth to OpenIDC

This commit is contained in:
Mikolaj Izdebski 2018-02-08 12:28:19 +01:00
parent d5db6392b4
commit 0eec23dcd8
5 changed files with 9 additions and 27 deletions

View file

@ -12,9 +12,11 @@ koschei_pgsql_hostname: db01.phx2.fedoraproject.org
koschei_koji_hub: koji02.phx2.fedoraproject.org koschei_koji_hub: koji02.phx2.fedoraproject.org
koschei_kojipkgs: kojipkgs.fedoraproject.org koschei_kojipkgs: kojipkgs.fedoraproject.org
koschei_koji_web: koji.fedoraproject.org koschei_koji_web: koji.fedoraproject.org
koschei_openid_provider: id.fedoraproject.org koschei_oidc_provider: id.fedoraproject.org
koschei_bugzilla: bugzilla.redhat.com koschei_bugzilla: bugzilla.redhat.com
koschei_oidc_client_secret: "{{ koschei_oidc_client_secret_prod }}"
koschei_oidc_crypto_secret: "{{ koschei_oidc_crypto_secret_prod }}"
tcp_ports: [ 80, 443 ] tcp_ports: [ 80, 443 ]

View file

@ -11,9 +11,12 @@ koschei_topurl: https://apps.stg.fedoraproject.org/koschei
koschei_pgsql_hostname: pgbdr.stg.phx2.fedoraproject.org koschei_pgsql_hostname: pgbdr.stg.phx2.fedoraproject.org
koschei_kojipkgs: koji.stg.fedoraproject.org koschei_kojipkgs: koji.stg.fedoraproject.org
koschei_koji_web: koji.stg.fedoraproject.org koschei_koji_web: koji.stg.fedoraproject.org
koschei_openid_provider: id.stg.fedoraproject.org koschei_oidc_provider: id.stg.fedoraproject.org
koschei_bugzilla: partner-bugzilla.redhat.com koschei_bugzilla: partner-bugzilla.redhat.com
koschei_oidc_client_secret: "{{ koschei_oidc_client_secret_stg }}"
koschei_oidc_crypto_secret: "{{ koschei_oidc_crypto_secret_stg }}"
tcp_ports: [ 80, 443 ] tcp_ports: [ 80, 443 ]
custom_rules: [ custom_rules: [

View file

@ -4,7 +4,7 @@
- koschei-frontend - koschei-frontend
- koschei-frontend-fedora - koschei-frontend-fedora
- koschei-frontend-copr - koschei-frontend-copr
- "{{ 'mod_auth_openidc' if env == 'staging' else 'mod_auth_openid' }}" - mod_auth_openidc
tags: tags:
- koschei - koschei
- packages - packages

View file

@ -61,20 +61,13 @@ config = {
"frontend": { "frontend": {
"builds_per_page": 8, "builds_per_page": 8,
"auth": { "auth": {
{% if env == 'staging' %}
"user_re": "(.+)", "user_re": "(.+)",
"user_env": "OIDC_CLAIM_nickname", "user_env": "OIDC_CLAIM_nickname",
{% else %}
"user_re": "http://(.+)\\.id{{ env_prefix }}\\.fedoraproject\\.org/",
{% endif %}
}, },
"fedora_assets_url": "/global", "fedora_assets_url": "/global",
"fedmenu_url": "/fedmenu", "fedmenu_url": "/fedmenu",
"fedmenu_data_url": "/js/data.js", "fedmenu_data_url": "/js/data.js",
}, },
"openid": {
"openid_provider": "{{ koschei_openid_provider }}",
},
"links": [ "links": [
{"name": "Packages", {"name": "Packages",
"url": "https://apps{{ env_prefix }}.fedoraproject.org/packages/{package.name}"}, "url": "https://apps{{ env_prefix }}.fedoraproject.org/packages/{package.name}"},

View file

@ -16,17 +16,11 @@
Require all granted Require all granted
</Directory> </Directory>
{% if env == 'staging' %}
OIDCRedirectURI "{{ koschei_topurl }}/login/redirect_uri" OIDCRedirectURI "{{ koschei_topurl }}/login/redirect_uri"
OIDCProviderMetadataURL "https://{{ koschei_openid_provider }}/openidc/wellknown_openid_configuration" OIDCProviderMetadataURL "https://{{ koschei_oidc_provider }}/openidc/wellknown_openid_configuration"
OIDCClientID "koschei" OIDCClientID "koschei"
{% if env == 'staging' %}
OIDCClientSecret "{{ koschei_oidc_client_secret_stg }}"
OIDCCryptoPassphrase "{{ koschei_oidc_crypto_secret_stg }}"
{% else %}
OIDCClientSecret "{{ koschei_oidc_client_secret }}" OIDCClientSecret "{{ koschei_oidc_client_secret }}"
OIDCCryptoPassphrase "{{ koschei_oidc_crypto_secret }}" OIDCCryptoPassphrase "{{ koschei_oidc_crypto_secret }}"
{% endif %}
OIDCSSLValidateServer On OIDCSSLValidateServer On
OIDCResponseType "code" OIDCResponseType "code"
@ -36,14 +30,4 @@
AuthType openid-connect AuthType openid-connect
Require valid-user Require valid-user
</Location> </Location>
{% else %}
<Location /koschei/login>
Require valid-user
AuthType OpenID
AuthOpenIDSingleIdP https://{{ koschei_openid_provider }}/
AuthOpenIDServerName https://apps.fedoraproject.org
AuthOpenIDTrustRoot https://apps.fedoraproject.org/koschei/
AuthOpenIDUseCookie off
</Location>
{% endif %}
</VirtualHost> </VirtualHost>