-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow adding multiple oidc plugins to your site (#48)
- Loading branch information
Showing
14 changed files
with
179 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Allow multiple instances of OIDC plugin in a given Plone site @erral |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Update locales.""" | ||
|
||
from pathlib import Path | ||
|
||
import logging | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<h1 tal:replace="structure here/manage_page_header">Header</h1> | ||
|
||
<main class="container-fluid" | ||
i18n:domain="pas.plugins.oidc" | ||
> | ||
|
||
<h2 tal:define=" | ||
form_title string:Add OIDC Plugin; | ||
" | ||
tal:replace="structure here/manage_form_title" | ||
>Form Title</h2> | ||
|
||
<p class="form-help" | ||
i18n:translate="" | ||
> | ||
OIDC Plugin manage the details of the OpenID Connect Authentication plugin | ||
Pluggable Auth Service functionality. | ||
</p> | ||
|
||
<form action="addOIDCPlugin" | ||
enctype="multipart/form-data" | ||
method="post" | ||
> | ||
|
||
<div class="form-group row"> | ||
<label class="form-label col-sm-3 col-md-2" | ||
for="id" | ||
i18n:translate="" | ||
>Id</label> | ||
<div class="col-sm-9 col-md-10"> | ||
<input class="form-control" | ||
id="id" | ||
name="id" | ||
type="text" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group row form-optional"> | ||
<label class="form-label col-sm-3 col-md-2" | ||
for="title" | ||
i18n:translate="" | ||
>Title</label> | ||
<div class="col-sm-9 col-md-10"> | ||
<input class="form-control" | ||
id="title" | ||
name="title" | ||
type="text" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<div class="zmi-controls"> | ||
<input class="btn btn-primary" | ||
name="submit" | ||
type="submit" | ||
value="Add" | ||
i18n:attributes="value" | ||
/> | ||
</div> | ||
|
||
</form> | ||
|
||
</main> | ||
|
||
<h1 tal:replace="structure here/manage_page_footer">Footer</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/services/test_servides_login_get_multiple_plugins.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pytest | ||
|
||
|
||
class TestSetupInstall: | ||
@pytest.fixture(autouse=True) | ||
def _initialize(self, google, api_anon_request): | ||
self.portal = google | ||
self.api_session = api_anon_request | ||
|
||
def test_login_get_available(self): | ||
response = self.api_session.get("@login") | ||
assert response.status_code == 200 | ||
data = response.json() | ||
assert isinstance(data, dict) | ||
|
||
@pytest.mark.parametrize( | ||
"idx, key, expected", | ||
[ | ||
[0, "id", "oidc"], | ||
[0, "plugin", "oidc"], | ||
[0, "url", "/@login-oidc/oidc"], | ||
[0, "title", "OpenID Connect"], | ||
[1, "id", "google"], | ||
[1, "plugin", "oidc"], | ||
[1, "url", "/@login-oidc/google"], | ||
[1, "title", "Google"], | ||
], | ||
) | ||
def test_login_get_options(self, idx: int, key: str, expected: str): | ||
response = self.api_session.get("@login") | ||
data = response.json() | ||
options = data["options"] | ||
assert expected in options[idx][key] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters