Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3f9410d
rust stuff
battermann Feb 15, 2023
a216a47
rust compiles
battermann Feb 15, 2023
93083b8
rust compiles
battermann Feb 15, 2023
4e0f572
wip
battermann Feb 16, 2023
ba70964
wip
battermann Feb 16, 2023
4c292bc
wip
battermann Feb 17, 2023
47ef9f2
works
battermann Feb 17, 2023
7997155
scope access
battermann Feb 20, 2023
673003f
oauth integration tests only using nginz
battermann Feb 20, 2023
7e2a584
return a tuple
battermann Feb 21, 2023
d94918f
free oauth key mem
battermann Feb 21, 2023
37f4cf3
naming convenetions
battermann Feb 21, 2023
7de3a20
get rid of rust warnings
battermann Feb 21, 2023
341e642
formatting
battermann Feb 21, 2023
80f8409
error propagation
battermann Feb 21, 2023
0b5bcec
oauth nginz pass locally
battermann Feb 21, 2023
befeca0
nginx config for CI
battermann Feb 21, 2023
223b0fb
oauth public key for nginz CI
battermann Feb 21, 2023
8ba3108
better rust
battermann Feb 21, 2023
45418cd
remove pub keys from brig and galley, fix stuff
battermann Feb 21, 2023
4961fef
clean up
battermann Feb 22, 2023
ec955fb
commt
battermann Feb 22, 2023
367e905
set oauth_scope in template correctly
battermann Feb 22, 2023
4bc1976
script
battermann Feb 22, 2023
90cd5f1
Update services/nginz/third_party/nginx-zauth-module/zauth_module.c
battermann Feb 22, 2023
e26a03e
WIP
pcapriotti Feb 22, 2023
1b3c2ca
Merge branch 'SQSERVICES-1913-oauth-move-o-auth-authentication-to-ngi…
battermann Feb 22, 2023
bcf6715
Merge branch 'SQSERVICES-1913-oauth-move-o-auth-authentication-to-ngi…
battermann Feb 22, 2023
fc92f75
clean up
battermann Feb 22, 2023
296b30a
zauth module clean up
battermann Feb 23, 2023
924dba4
clean up
battermann Feb 23, 2023
49d1fd9
remove spaces
battermann Feb 23, 2023
626ddb1
typo in nginx.conf
battermann Feb 23, 2023
5b07b11
check for oom error
battermann Feb 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions charts/galley/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ data:
{{- end -}}
{{- if .settings.disabledAPIVersions }}
disabledAPIVersions: {{ .settings.disabledAPIVersions }}
{{- end }}
{{- if $.Values.secrets.oauthPublicJwk }}
oauthPublicJwk: /etc/wire/galley/secrets/oauth_ed25519_pub.jwk
{{- end }}
{{- end }}
{{- if .settings.featureFlags }}
featureFlags:
sso: {{ .settings.featureFlags.sso }}
Expand Down
3 changes: 0 additions & 3 deletions charts/galley/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ data:
removal_ed25519.pem: {{ .Values.secrets.mlsPrivateKeys.removal.ed25519 | b64enc | quote }}
{{- end -}}
{{- end -}}
{{- if .Values.secrets.oauthPublicJwk }}
oauth_ed25519_pub.jwk: {{ .Values.secrets.oauthPublicJwk | b64enc | quote }}
{{- end -}}
10 changes: 8 additions & 2 deletions charts/nginz/templates/conf/_nginx.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ http {

zauth_keystore {{ .Values.nginx_conf.zauth_keystore }};
zauth_acl {{ .Values.nginx_conf.zauth_acl }};
oauth_key {{ .Values.nginx_conf.oauth_key }};

location /status {
zauth off;
Expand Down Expand Up @@ -258,8 +259,8 @@ http {
{{- end }}
{{- end }}

{{- if ($location.enable_oauth) }}
oauth on;
{{- if ($location.oauth_scope) }}
oauth_scope {{ $location.oauth_scope }};
{{- end }}

{{- if hasKey $location "specific_user_rate_limit" }}
Expand Down Expand Up @@ -293,6 +294,10 @@ http {
proxy_set_header Connection "";
{{ end -}}

{{- if not ($location.disable_zauth) }}
proxy_set_header Authorization "";
{{- end }}

proxy_set_header Z-Type $zauth_type;
proxy_set_header Z-User $zauth_user;
proxy_set_header Z-Client $zauth_client;
Expand Down Expand Up @@ -345,6 +350,7 @@ http {
# we need to specify zauth_keystore etc.
zauth_keystore {{ .Values.nginx_conf.zauth_keystore }};
zauth_acl {{ .Values.nginx_conf.zauth_acl }};
oauth_key {{ .Values.nginx_conf.oauth_key }};

listen {{ .Values.config.http.metricsPort }};

Expand Down
1 change: 1 addition & 0 deletions charts/nginz/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ data:
{{- with .Values.secrets }}
zauth.conf: {{ .zAuth.publicKeys | b64enc | quote }}
basic_auth.txt: {{ .basicAuth | b64enc | quote }}
oauth_ed25519_pub.jwk: {{ .oAuth.publicKeys | b64enc | quote }}
{{- end }}
16 changes: 13 additions & 3 deletions charts/nginz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ nginx_conf:
zauth_keystore: /etc/wire/nginz/secrets/zauth.conf
zauth_acl: /etc/wire/nginz/conf/zauth.acl
basic_auth_file: /etc/wire/nginz/secrets/basic_auth.txt
oauth_key: /etc/wire/nginz/secrets/oauth_ed25519_pub.jwk
worker_processes: auto
worker_rlimit_nofile: 131072
worker_connections: 65536
Expand Down Expand Up @@ -163,7 +164,7 @@ nginx_conf:
envs:
- staging
- path: /self$ # Matches exactly /self
enable_oauth: true
oauth_scope: self
envs:
- all
- path: /self/name
Expand Down Expand Up @@ -424,11 +425,20 @@ nginx_conf:
- all
max_body_size: 40m
body_buffer_size: 256k
- path: /conversations$
envs:
- all
doc: true
oauth_scope: conversations
- path: /conversations/([^/]*)/code
envs:
- all
doc: true
oauth_scope: conversations_code
- path: /conversations
envs:
- all
doc: true
enable_oauth: true
- path: /legalhold/conversations/(.*)
envs:
- all
Expand Down Expand Up @@ -496,7 +506,7 @@ nginx_conf:
- path: /feature-configs(.*)
envs:
- all
enable_oauth: true
oauth_scope: feature_configs
- path: /mls/welcome
envs:
- all
Expand Down
10 changes: 0 additions & 10 deletions docs/src/developer/reference/config-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ certificate, is to run the following command:
openssl req -nodes -newkey ed25519 -keyout ed25519.pem -out /dev/null -subj /
```

### Public JWK for OAuth

Set the path to the public JWK key for OAuth like this:

```yml
# [galley.yaml]
settings:
oauthPublicJwk: test/resources/oauth/ed25519_public.jwk
```

## Feature flags

> Also see [Wire docs](https://docs.wire.com/how-to/install/team-feature-settings.html) where some of the feature flags are documented from an operations point of view.
Expand Down
2 changes: 1 addition & 1 deletion hack/bin/oauth_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ echo "access token : $ACCESS_TOKEN"

echo ""
echo "making a request to /self..."
curl -s -H 'Z-OAUTH: Bearer '"$ACCESS_TOKEN" -H "Content-Type: application/json" localhost:8082/self | jq .
curl -s -H 'Authorization: Bearer '"$ACCESS_TOKEN" -H "Content-Type: application/json" localhost:8080/self | jq
15 changes: 8 additions & 7 deletions hack/helm_vars/wire-server/values.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ brig:
setDpopTokenExpirationTimeSecs: 300
setEnableMLS: true
setOAuthAuthCodeExpirationTimeSecs: 3 # 3 secs
setOAuthAccessTokenExpirationTimeSecs: 1814400 # 3 weeks
setOAuthAccessTokenExpirationTimeSecs: 3 # 3 secs
setOAuthEnabled: true
setOAuthRefreshTokenExpirationTimeSecs: 14515200 # 24 weeks
setOAuthMaxActiveRefreshTokens: 10
Expand Down Expand Up @@ -193,12 +193,6 @@ galley:
-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIAocCDXsKIAjb65gOUn5vEF0RIKnVJkKR4ebQzuZ709c
-----END PRIVATE KEY-----
oauthPublicJwk: |
{
"kty": "OKP",
"crv": "Ed25519",
"x": "mhP-NgFw3ifIXGZqJVB0kemt9L3BtD5P8q4Gah4Iklc"
}

gundeck:
replicaCount: 1
Expand Down Expand Up @@ -244,6 +238,13 @@ nginz:
zAuth:
# this must match the key in brig!
publicKeys: 0UW38se1yeoc5bVNEvf5LyrHWGZkyvcGTVilK2geGdU=
oAuth:
publicKeys: |
{
"kty": "OKP",
"crv": "Ed25519",
"x": "mhP-NgFw3ifIXGZqJVB0kemt9L3BtD5P8q4Gah4Iklc"
}
proxy:
replicaCount: 1
imagePullPolicy: {{ .Values.imagePullPolicy }}
Expand Down
Loading