Skip to content

Commit

Permalink
feat(tent): support additional params (#4044)
Browse files Browse the repository at this point in the history
* test(register): mock register_client method

was causing this test to break

Signed-off-by: christian <eland.christian@gmail.com>

* test(tent): mock clienthandler methods

Signed-off-by: christian <eland.christian@gmail.com>

* test(tent): move mocks to a separate helper method

Signed-off-by: christian <eland.christian@gmail.com>

* chore(tent): bump deps

httlib2, certifi, Authlib

Signed-off-by: christian <eland.christian@gmail.com>

* test(tent): restore stashed register_client

Signed-off-by: christian <eland.christian@gmail.com>

* test(tent): remove internet dependant

Mocking also does not make sense

Signed-off-by: christian <eland.christian@gmail.com>

* test(tent): remove login endpoint integration

tests are unmockable

Signed-off-by: christian <eland.christian@gmail.com>

* Set stable to v1.0.6

* chore: remove config.py from gitignore

* refactor(tent): move config_dummy to config.py

* feat(tent): support additional params

Params will be loaded from config `ADDITIONAL_PARAMS`

* ci: remove helm resources

---------

Signed-off-by: christian <eland.christian@gmail.com>
Co-authored-by: mo-auto <54212639+mo-auto@users.noreply.github.com>
Co-authored-by: moabu <47318409+moabu@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 13, 2023
1 parent 2cf8aa0 commit f521f7a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
1 change: 0 additions & 1 deletion demos/jans-tent/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#auth-client-tdd-specific
clientapp/config.py
clientapp/client_secrets.json

# Byte-compiled / optimized / DLL files
Expand Down
5 changes: 5 additions & 0 deletions demos/jans-tent/clientapp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ def login():
if cfg.PROVIDER_HOST_STRING is not None:
query_args["providerHost"] = get_provider_host()


if cfg.ADDITIONAL_PARAMS is not None:
query_args |= cfg.ADDITIONAL_PARAMS


response = oauth.op.authorize_redirect(**query_args)

app.logger.debug('/login authorize_redirect(redirect_uri) url = %s' %
Expand Down
52 changes: 52 additions & 0 deletions demos/jans-tent/clientapp/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
'''
Project: Test Auth Client
Author: Christian Hawk
Copyright 2023 Christian Hawk
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an 'AS IS' BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'''

CLIENT_ID = "YOUR-CLIENT-ID"
CLIENT_SECRET = "YOUR-CLIENT-SECRET"
SERVER_META_URL = 'https://YOUR_OP_HOST/.well-known/openid-configuration'
REDIRECT_URIS = [
'https://localhost:9090/oidc_callback'
]

USERINFO_URI = "https://your-userinfo-endpoint"

ISSUER = "https://your-server-fqdn"


# Token authentication method can be
# client_secret_basic
# client_secret_post
# none

SERVER_TOKEN_AUTH_METHOD = "client_secret_post"

# for gluu
ACR_VALUES = 'agama'
PRE_SELECTED_PROVIDER = False
PRE_SELECTED_PROVIDER_ID = ''
HAS_PROVIDER_HOST = False
PROVIDER_HOST_STRING = None

# ADDITIONAL PARAMS TO CALL AUTHORIZE ENDPOINT, WITHOUT BASE64 ENCODING. USE DICT {'param': 'value'}
# ADDITIONAL_PARAMS = {'paramOne': 'valueOne', 'paramTwo': 'valueTwo'}
ADDITIONAL_PARAMS = None


# SYSTEM SETTINGS
# use with caution, unsecure requests, for develpment environments
SSL_VERIFY = False

0 comments on commit f521f7a

Please sign in to comment.