From 6d9c61dc0072b96b12153e64940b465306f25bfb Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 7 Aug 2023 07:58:09 +0300 Subject: Change imports to new unified db module. --- gn_auth/templates/admin/dashboard.html | 24 ++++++++ gn_auth/templates/admin/list-oauth2-clients.html | 56 +++++++++++++++++ gn_auth/templates/admin/login.html | 32 ++++++++++ gn_auth/templates/admin/register-client.html | 78 ++++++++++++++++++++++++ gn_auth/templates/admin/registered-client.html | 21 +++++++ gn_auth/templates/admin/view-oauth2-client.html | 75 +++++++++++++++++++++++ gn_auth/templates/base.html | 24 ++++++++ gn_auth/templates/common-macros.html | 7 +++ gn_auth/templates/oauth2/authorise-user.html | 48 +++++++++++++++ gn_auth/templates/oauth2/oauth2_error.html | 16 +++++ 10 files changed, 381 insertions(+) create mode 100644 gn_auth/templates/admin/dashboard.html create mode 100644 gn_auth/templates/admin/list-oauth2-clients.html create mode 100644 gn_auth/templates/admin/login.html create mode 100644 gn_auth/templates/admin/register-client.html create mode 100644 gn_auth/templates/admin/registered-client.html create mode 100644 gn_auth/templates/admin/view-oauth2-client.html create mode 100644 gn_auth/templates/base.html create mode 100644 gn_auth/templates/common-macros.html create mode 100644 gn_auth/templates/oauth2/authorise-user.html create mode 100644 gn_auth/templates/oauth2/oauth2_error.html (limited to 'gn_auth/templates') diff --git a/gn_auth/templates/admin/dashboard.html b/gn_auth/templates/admin/dashboard.html new file mode 100644 index 0000000..7798022 --- /dev/null +++ b/gn_auth/templates/admin/dashboard.html @@ -0,0 +1,24 @@ +{%extends "base.html"%} + +{%block title%}Genenetwork3: Admin Dashboard{%endblock%} + +{%block pagetitle%}Admin Dashboard{%endblock%} + +{%block content%} +{{flash_messages()}} + + +{%endblock%} diff --git a/gn_auth/templates/admin/list-oauth2-clients.html b/gn_auth/templates/admin/list-oauth2-clients.html new file mode 100644 index 0000000..0104f0d --- /dev/null +++ b/gn_auth/templates/admin/list-oauth2-clients.html @@ -0,0 +1,56 @@ +{%extends "base.html"%} + +{%block title%}Genenetwork3: OAuth2 Clients{%endblock%} + +{%block pagetitle%}OAuth2 Clients{%endblock%} + +{%block content%} +{{flash_messages()}} + + + + + + + + + + + + + + + {%for client in clients%} + + + + + + + + + {%else%} + + + + {%endfor%} + + +{%endblock%} diff --git a/gn_auth/templates/admin/login.html b/gn_auth/templates/admin/login.html new file mode 100644 index 0000000..ac217ab --- /dev/null +++ b/gn_auth/templates/admin/login.html @@ -0,0 +1,32 @@ +{%extends "base.html"%} + +{%block title%}Log in to Genenetwork3{%endblock%} + +{%block pagetitle%}Admin Log In{%endblock%} + +{%block content%} +{{flash_messages()}} + +
+ +
+ User Credentials + + + +
+ + +
+ +
+ + +
+
+ + +
+{%endblock%} diff --git a/gn_auth/templates/admin/register-client.html b/gn_auth/templates/admin/register-client.html new file mode 100644 index 0000000..daac977 --- /dev/null +++ b/gn_auth/templates/admin/register-client.html @@ -0,0 +1,78 @@ +{%extends "base.html"%} + +{%block title%}Genenetwork3: Register OAuth2 Client{%endblock%} + +{%block pagetitle%}Register OAuth2 Client{%endblock%} + +{%block content%} +{{flash_messages()}} + +
+ +
+ Select client scope + + {%for scp in scope%} + +
+ {%endfor%} + +
+ +
+ Basic OAuth2 client information + + + + +

+ + + +

+ + +
+ +

+
+ Supported grant types + + +

+ + + +
+
+ +
+ User information + +

The user to register this client for

+ +
+ + +
+{%endblock%} diff --git a/gn_auth/templates/admin/registered-client.html b/gn_auth/templates/admin/registered-client.html new file mode 100644 index 0000000..5c46f4d --- /dev/null +++ b/gn_auth/templates/admin/registered-client.html @@ -0,0 +1,21 @@ +{%extends "base.html"%} + +{%block title%}Genenetwork3: Register OAuth2 Client{%endblock%} + +{%block pagetitle%}Register OAuth2 Client{%endblock%} + +{%block content%} +{{flash_messages()}} + +

Client has been registered successfully.

+ +

Please save the following client details somewhere. There is no way to + retrieve the the CLIENT_SECRET once you leave this page.

+ +
+
CLIENT_ID
+
{{client.client_id}}
+
CLIENT_SECRET
+
{{client_secret}}
+
+{%endblock%} diff --git a/gn_auth/templates/admin/view-oauth2-client.html b/gn_auth/templates/admin/view-oauth2-client.html new file mode 100644 index 0000000..b90428d --- /dev/null +++ b/gn_auth/templates/admin/view-oauth2-client.html @@ -0,0 +1,75 @@ +{%extends "base.html"%} + +{%block title%}Genenetwork3: View OAuth2 Client{%endblock%} + +{%block pagetitle%}View OAuth2 Client{%endblock%} + +{%block content%} +{{flash_messages()}} + +{%if client.is_nothing()%} +

No such client

+{%else%} +{%set client = client.value%} +
+ View/Edit Oauth2 Client + +
+

Client ID: {{client.client_id}}

+

Client Name: {{client.client_metadata.client_name}}

+
+
+ Scope + {%for scp in scope%} + +
+ {%endfor%} +
+ +
+ Redirect URIs + +
+ +

+ + +
+ +
+ +
+ Grants + + +

+ + + +
+ + + +{%endif%} +{%endblock%} diff --git a/gn_auth/templates/base.html b/gn_auth/templates/base.html new file mode 100644 index 0000000..db08545 --- /dev/null +++ b/gn_auth/templates/base.html @@ -0,0 +1,24 @@ +{% from "common-macros.html" import flash_messages%} + + + + + + + Genenetwork 3: {%block title%}{%endblock%} + + + + {%block css%}{%endblock%} + + + +

Genenetwork3: {%block pagetitle%}{%endblock%}

+ +
+ {%block content%}{%endblock%} +
+ {%block js%}{%endblock%} + + diff --git a/gn_auth/templates/common-macros.html b/gn_auth/templates/common-macros.html new file mode 100644 index 0000000..1d9f302 --- /dev/null +++ b/gn_auth/templates/common-macros.html @@ -0,0 +1,7 @@ +{%macro flash_messages()%} +
+ {%for category,message in get_flashed_messages(with_categories=true)%} + + {%endfor%} +
+{%endmacro%} diff --git a/gn_auth/templates/oauth2/authorise-user.html b/gn_auth/templates/oauth2/authorise-user.html new file mode 100644 index 0000000..b9284e5 --- /dev/null +++ b/gn_auth/templates/oauth2/authorise-user.html @@ -0,0 +1,48 @@ +{%extends "base.html"%} + +{%block title%}Authorise User{%endblock%} + +{%block pagetitle%}Authenticate to the API Server{%endblock%} + +{%block content%} +{{flash_messages()}} + +
+ + + +

+ You are authorising "{{client.client_metadata.client_name}}" to access + Genenetwork 3 with the following scope: +

+
+ Scope + {%for scp in scope%} +
+ +
+ {%endfor%} +
+ +
+ User Credentials +
+ + +
+ +
+ + +
+
+ + +
+{%endblock%} diff --git a/gn_auth/templates/oauth2/oauth2_error.html b/gn_auth/templates/oauth2/oauth2_error.html new file mode 100644 index 0000000..ec9a500 --- /dev/null +++ b/gn_auth/templates/oauth2/oauth2_error.html @@ -0,0 +1,16 @@ +{%extends "base.html"%} + +{%block title%}OAuth2 Error{%endblock%} + +{%block pagetitle%}Error: {{error.status_code}}{%endblock%} + +{%block content%} +{{flash_messages()}} + +There was an error trying to fulfill your request: + +

+ {{error.error}}: + {{error.description}} +

+{%endblock%} -- cgit v1.2.3