Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8392173
test_auth.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
774 B
Subscribers
None
test_auth.py
View Options
# Copyright (C) 2021 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
import
pytest
from
swh.auth
import
KeycloakOpenIDConnect
from
.conftest
import
REALM
,
SERVER_URL
,
WELL_KNOWN
@pytest.fixture
def
keycloak_open_id_connect
():
return
KeycloakOpenIDConnect
(
server_url
=
SERVER_URL
,
realm_name
=
REALM
,
client_id
=
"client-id"
,
)
def
test_auth_well_known
(
mock_keycloak
,
keycloak_open_id_connect
):
well_known_result
=
keycloak_open_id_connect
.
well_known
()
assert
well_known_result
is
not
None
assert
well_known_result
==
WELL_KNOWN
assert
mock_keycloak
.
called
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Jun 4 2025, 6:55 PM (11 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3398869
Attached To
rDAUTH Common authentication libraries
Event Timeline
Log In to Comment