Skip to content

Commit

Permalink
chore: cleanup migration
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmundy committed Feb 25, 2020
1 parent 781d771 commit 8f6bbd5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ PROJECT_NAME := authserver
VERSION := 0.0.1
AWS_ECR_REPO := 396527728813.dkr.ecr.us-east-2.amazonaws.com

image: aws_login
image:
docker build -t $(ORGANIZATION)/$(PROJECT_NAME):$(VERSION)-$(COMMIT_TAG) .
docker tag $(ORGANIZATION)/$(PROJECT_NAME):$(VERSION)-$(COMMIT_TAG) $(AWS_ECR_REPO)/$(ORGANIZATION)/$(PROJECT_NAME):$(VERSION)-$(COMMIT_TAG)
docker push $(AWS_ECR_REPO)/$(ORGANIZATION)/$(PROJECT_NAME):$(VERSION)-$(COMMIT_TAG)

aws_login:
aws ecr get-login --no-include-email --region us-east-2
$(aws ecr get-login --no-include-email --region us-east-2)

release: clean image
docker tag $(ORGANIZATION)/$(PROJECT_NAME):$(VERSION)-$(COMMIT_TAG) $(AWS_ECR_REPO)/$(ORGANIZATION)/$(PROJECT_NAME):$(VERSION)
Expand Down
2 changes: 1 addition & 1 deletion authserver/api/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _client_authorized(client_id, user_id):
def authorize():
errors = None
user = _current_user()

print('Hello........')
if not user:
client_id = request.args.get('client_id')
return redirect(url_for('home_ep.login', client_id=client_id, return_to=request.url))
Expand Down
36 changes: 8 additions & 28 deletions migrations/versions/1794e645d265_.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ def upgrade():
op.bulk_insert(user_table, [
{
'id': admin_user_id,
'username': 'test_user',
'firstname': 'Test',
'lastname': 'User',
'username': 'brighthive_admin',
'firstname': 'BrightHive',
'lastname': 'Administrator',
'organization': 'BrightHive',
'email_address': 'test_user@brighthive.net',
'email_address': 'brighthive_admin@brighthive.net',
'active': True,
'data_trust_id': data_trust_id,
'password_hash': hash_password('143DATATRUST341'),
Expand All @@ -97,15 +97,6 @@ def upgrade():
}
])

m2m_client_metadata = {
'client_name': 'M2M Client',
'token_endpoint_auth_method': 'client_secret_json',
'grant_types': ['client_credentials'],
'response_types': ['token'],
'client_uri': 'http://localhost:8000',
'scope': ''
}

facet_client_metadata = {
'client_name': 'Facet',
'token_endpoint_auth_method': 'none',
Expand All @@ -127,17 +118,6 @@ def upgrade():
}

op.bulk_insert(oauth2_client_table, [
# Set up a confidential client (M2M access)
{
'client_id': 'd84UZXW7QcB5ufaVT15C9BtO',
'client_secret': 'cTQfd67c5uN9df8g56U8T5CwbF9S0LDgl4imUDguKkrGSuzI',
'client_id_issued_at': int(time.time()),
'client_secret_expires_at': 0,
'client_metadata': json.dumps(m2m_client_metadata),
'id': str(uuid4()).replace('-', ''),
'user_id': admin_user_id

},
# Set up a public client (Facet)
{
'client_id': 'ru2tFykoIcR6vSWpsLgnYTpg',
Expand Down Expand Up @@ -201,8 +181,8 @@ def upgrade():
op.bulk_insert(user_table, [
{
'id': admin_user_id,
'username': 'facet_admin',
'firstname': 'Facet',
'username': 'brighthive_admin',
'firstname': 'BrightHive',
'lastname': 'Administrator',
'organization': 'BrightHive',
'email_address': '[email protected]',
Expand All @@ -228,8 +208,8 @@ def upgrade():
'token_endpoint_auth_method': 'none',
'grant_types': ['authorization_code'],
'response_types': ['code'],
'client_uri': 'http://localhost:8000',
'redirect_uris': ['http://localhost:8000/auth/redirect'],
'client_uri': 'http://localhost:8001',
'redirect_uris': ['http://localhost:8001/auth/redirect'],
'scope': ''
}

Expand Down

0 comments on commit 8f6bbd5

Please sign in to comment.