generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP adding a frontpage to prompt login
- Loading branch information
1 parent
9094b5e
commit 494641f
Showing
8 changed files
with
30 additions
and
18 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
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,7 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
<h1 class="govuk-heading-xl">Analytical Platform Dashboard</h1> | ||
|
||
<p><a class="govuk-button" href="{% url 'login' %}">Sign in</a></p> | ||
{% endblock content %} |
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 |
---|---|---|
|
@@ -25,6 +25,10 @@ def get_context_data(self, **kwargs: Any) -> dict[str, Any]: | |
return context | ||
|
||
|
||
class LoginPromptView(TemplateView): | ||
template_name = "login.html" | ||
|
||
|
||
class QuicksightView(OIDCLoginRequiredMixin, TemplateView): | ||
template_name = "quicksight.html" | ||
|
||
|
@@ -35,7 +39,7 @@ def get_context_data(self, **kwargs: Any) -> dict[str, Any]: | |
session_name = "michaeljcollinsuk" | ||
try: | ||
response = qs.register_user( | ||
IdentityType='IAM', | ||
IdentityType="IAM", | ||
IamArn=f"arn:aws:iam::525294151996:role/{rolename}", | ||
SessionName=session_name, | ||
Email="[email protected]", | ||
|
@@ -51,7 +55,7 @@ def get_context_data(self, **kwargs: Any) -> dict[str, Any]: | |
response = qs.generate_embed_url_for_registered_user( | ||
**{ | ||
"AwsAccountId": os.environ.get("QUICKSIGHT_ACCOUNT_ID"), | ||
"UserArn": f"arn:aws:quicksight:eu-west-1:525294151996:user/default/{rolename}/{session_name}", | ||
"UserArn": f"arn:aws:quicksight:eu-west-1:525294151996:user/default/{rolename}/{session_name}", # noqa | ||
"ExperienceConfiguration": {"QuickSightConsole": {"InitialPath": "/start"}}, | ||
} | ||
) | ||
|
@@ -70,9 +74,10 @@ def describe_policy_assignment(self, qs, name): | |
return qs.describe_iam_policy_assignment( | ||
AwsAccountId=os.environ.get("QUICKSIGHT_ACCOUNT_ID"), | ||
Namespace="default", | ||
AssignmentName="michael-test-1" | ||
AssignmentName="michael-test-1", | ||
) | ||
|
||
|
||
class DatasourcesList(OIDCLoginRequiredMixin, ListView): | ||
template_name = "datasources-list.html" | ||
model = Datasource | ||
|
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