Skip to content

Commit

Permalink
update config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelLukowski committed May 6, 2024
1 parent ce109ac commit a78b851
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,15 @@
"hashed_secret": "109f4b3c50d7b0df729d299bc6f8e9ef9066971f",
"is_verified": false,
"line_number": 13
},
{
"type": "Secret Keyword",
"filename": "tests/test_settings.json",
"hashed_secret": "3ebfa301dc59196f18593c45e519287a23297589",
"is_verified": false,
"line_number": 28
}
]
},
"generated_at": "2023-09-19T21:25:48Z"
"generated_at": "2024-05-06T17:05:13Z"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Two methods exist for authenticating a request to the `/token` endpoint:
"idp": "keycloak",
"auth_url": "auth/realms/xyz/protocol/openid-connect/auth",
"token_url": "auth/realms/xyz/protocol/openid-connect/token",
"id_token_username": "email"
"id_token_username": "email",
"scope": "openid profile offline_access"
}
}
Expand Down
6 changes: 6 additions & 0 deletions tests/app_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ def test_app_config(app):
app.config["OIDC"]["idp_a"]["redirect_uri"]
== "https://workspace.planx-pla.net/wts-callback"
)
assert app.config["OIDC"]["idp_a"]["username_field"] == "context.user.name"
assert (
app.config["OIDC"]["externaldata-keycloak"]["authorize_url"]
== "https://non-fence-data.org/auth/realms/xyz/protocol/openid-connect/auth"
)
assert app.config["OIDC"]["externaldata-keycloak"]["username_field"] == "email"
assert app.config["OIDC"]["idp_a"]["state_prefix"] == "test"
assert (
app.config["OIDC"]["default"]["redirect_uri"]
Expand Down
17 changes: 17 additions & 0 deletions tests/test_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@
"params": {"idp": "fence", "fence_idp": "shibboleth"}
}
}
},
{
"base_url": "https://non-fence-data.org/",
"oidc_client_id": "test3",
"oidc_client_secret": "test3",
"login_options": {
"externaldata-keycloak": {
"name": "keycloak Login",
"params": {
"idp": "keycloak",
"auth_url": "auth/realms/xyz/protocol/openid-connect/auth",
"token_url": "auth/realms/xyz/protocol/openid-connect/token",
"id_token_username": "email",
"scope": "openid profile offline_access"
}
}
}
}
]
}

0 comments on commit a78b851

Please sign in to comment.