Skip to content

Commit

Permalink
Revert "Feat/user authentication (#3)"
Browse files Browse the repository at this point in the history
This reverts commit 5bed810.
  • Loading branch information
jsandoval81 committed Aug 7, 2024
1 parent 3f240c2 commit a572ebc
Show file tree
Hide file tree
Showing 58 changed files with 391 additions and 1,357 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/check-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,5 @@ jobs:
- name: Install all dependencies
run: "cd backend; bin/sync_deps.sh"

- name: Check Dependencies
run: "pip-audit"

- name: Test backend
run: "cd backend; bin/run_tests.sh no-report"
2 changes: 0 additions & 2 deletions backend/bin/compile_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ pip-compile --no-emit-index-url --upgrade compact-connect/lambdas/license-data/r
pip-compile --no-emit-index-url --upgrade compact-connect/lambdas/license-data/requirements-dev.in
pip-compile --no-emit-index-url --upgrade compact-connect/lambdas/board-user-pre-token/requirements.in
pip-compile --no-emit-index-url --upgrade compact-connect/lambdas/board-user-pre-token/requirements-dev.in
pip-compile --no-emit-index-url --upgrade compact-connect/lambdas/staff-user-pre-token/requirements.in
pip-compile --no-emit-index-url --upgrade compact-connect/lambdas/staff-user-pre-token/requirements-dev.in
pip-compile --no-emit-index-url --upgrade compact-connect/lambdas/delete-objects/requirements.in
pip-compile --no-emit-index-url --upgrade compact-connect/lambdas/delete-objects/requirements-dev.in
bin/sync_deps.sh
1 change: 0 additions & 1 deletion backend/bin/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ REPORT="$1"
for dir in \
compact-connect/lambdas/license-data \
compact-connect/lambdas/board-user-pre-token \
compact-connect/lambdas/staff-user-pre-token \
compact-connect/lambdas/delete-objects \
multi-account
do
Expand Down
2 changes: 0 additions & 2 deletions backend/bin/sync_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ pip-sync \
compact-connect/lambdas/license-data/requirements-dev.txt \
compact-connect/lambdas/board-user-pre-token/requirements.txt \
compact-connect/lambdas/board-user-pre-token/requirements-dev.txt \
compact-connect/lambdas/staff-user-pre-token/requirements.txt \
compact-connect/lambdas/staff-user-pre-token/requirements-dev.txt \
compact-connect/lambdas/delete-objects/requirements.txt \
compact-connect/lambdas/delete-objects/requirements-dev.txt
5 changes: 1 addition & 4 deletions backend/compact-connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ To execute the tests, simply run `bin/run_tests.sh` from the `backend` directory
The very first deploy to a new environment (like your personal sandbox account) requires a few steps to fully set up
its environment:
1) *Optional:* Create a new Route53 HostedZone in your AWS sandbox account for the DNS domain name you want to use for
your app. See [About Route53 Hosted Zones](#about-route53-hosted-zones) for more. Note: Without this step, you will
not be able to log in to the UI hosted in CloudFront. The Oauth2 authentication process requires a predictable
callback url to be pre-configured, which the domain name provides. You can still run a local UI against this app,
so long as you leave the `allow_local_ui` context value set to `true` in your environment's context.
your app. See [About Route53 Hosted Zones](#about-route53-hosted-zones) for more.
2) Copy [cdk.context.sandbox-example.json](./cdk.context.sandbox-example.json) to `cdk.context.json`.
3) At the top level of the JSON structure update the `"environment_name"` field to your own name.
4) Update the environment entry under `ssm_context.environments` to your own name and your own AWS sandbox account id,
Expand Down
148 changes: 0 additions & 148 deletions backend/compact-connect/bin/create_staff_user.py

This file was deleted.

3 changes: 1 addition & 2 deletions backend/compact-connect/cdk.context.production-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"test": {
"account_id": "111122223333",
"region": "us-east-1",
"domain_name": "test.app.compactconnect.org",
"allow_local_ui": true
"domain_name": "test.app.compactconnect.org"
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions backend/compact-connect/cdk.context.sandbox-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"justin": {
"account_id": "111122223333",
"region": "us-east-1",
"domain_name": "justin.compactconnect.org",
"allow_local_ui": true
"domain_name": "justin.compactconnect.org"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions backend/compact-connect/cdk.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
},
"compacts": [
"aslp",
"octp",
"coun"
"ot",
"counseling"
],
"@aws-cdk/aws-lambda:recognizeLayerVersion": true,
"@aws-cdk/core:checkSecretUsage": true,
Expand Down
33 changes: 0 additions & 33 deletions backend/compact-connect/common_constructs/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from textwrap import dedent

from aws_cdk import Stack as CdkStack, Aspects
from aws_cdk.aws_route53 import HostedZone, IHostedZone
from cdk_nag import AwsSolutionsChecks, HIPAASecurityChecks, NagSuppressions


Expand Down Expand Up @@ -87,35 +86,3 @@ def common_env_vars(self):
'JURISDICTIONS': json.dumps(self.node.get_context('jurisdictions')),
'LICENSE_TYPES': json.dumps(self.node.get_context('license_types'))
}


class AppStack(Stack):
"""
A stack that is part of the main app deployment
"""
def __init__(self, *args, environment_context: dict, **kwargs):
super().__init__(*args, **kwargs)
self.environment_context = environment_context

@cached_property
def hosted_zone(self) -> IHostedZone | None:
hosted_zone = None
domain_name = self.environment_context.get('domain_name')
if domain_name is not None:
hosted_zone = HostedZone.from_lookup(
self, 'HostedZone',
domain_name=domain_name
)
return hosted_zone

@property
def api_domain_name(self) -> str | None:
if self.hosted_zone is not None:
return f'api.{self.hosted_zone.zone_name}'
return None

@property
def ui_domain_name(self) -> str | None:
if self.hosted_zone is not None:
return f'app.{self.hosted_zone.zone_name}'
return None
6 changes: 4 additions & 2 deletions backend/compact-connect/common_constructs/user_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(
]
)

def add_ui_client(self, callback_urls: List[str], ui_scopes: List[OAuthScope] = None):
def add_ui_client(self, ui_scopes: List[OAuthScope] = None):
return self.add_client(
'UIClient',
auth_flows=AuthFlow(
Expand All @@ -94,7 +94,9 @@ def add_ui_client(self, callback_urls: List[str], ui_scopes: List[OAuthScope] =
user_password=False
),
o_auth=OAuthSettings(
callback_urls=callback_urls,
callback_urls=[
'http://localhost:8000/auth'
],
flows=OAuthFlows(
authorization_code_grant=True,
implicit_code_grant=False
Expand Down
Loading

0 comments on commit a572ebc

Please sign in to comment.