Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated src/main, because on changing the FastAPI version on_event(st… #100

Merged
merged 6 commits into from
Jan 26, 2024

Conversation

nargis-sultani
Copy link
Contributor

…artup) was depecated in the new version.

Incorporated ragtech_commons_api and deleted the old ones

…artup) was depecated in the new version.

Incorporated ragtech_commons_api and deleted the old ones
Copy link

github-actions bot commented Jan 24, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src
  config.py
  main.py 33-37
  src/entities/models
  dto.py
  src/routers
  admin.py
  institutions.py
  src/util
  __init__.py
Project Total  

This report was generated by python-coverage-comment-action

@nargis-sultani nargis-sultani linked an issue Jan 24, 2024 that may be closed by this pull request
@nargis-sultani nargis-sultani changed the title Updated src/main, because on changing thr FastAPI version on_event(st… Updated src/main, because on changing the FastAPI version on_event(st… Jan 24, 2024
from regtech_api_commons.models.auth import AuthenticatedUser
from regtech_api_commons.oauth2 import oauth2_admin

oauth2_admin.OAuth2Admin.update_user

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line supposed to be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops, nope. Removing it now.

jcadam14
jcadam14 previously approved these changes Jan 25, 2024
Copy link
Contributor

@jcadam14 jcadam14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now!

@@ -21,12 +22,12 @@ def get_me(request: Request):
@router.put("/me/", status_code=HTTPStatus.ACCEPTED, dependencies=[Depends(check_domain)])
@requires("manage-account")
def update_me(request: Request, user: UserProfile):
oauth2_admin.update_user(request.user.id, user.to_keycloak_user())
OAuth2Admin.update_user(request.user.id, user.to_keycloak_user())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should be creating an instance of the class, not use the class methods in a static fashion, not quite sure how this is working with the _admin attribute not constructed within the instance...

@@ -20,7 +21,7 @@ def test_jwt_opts_valid_values():
"jwt_opts_test2": "true",
"jwt_opts_test3": "12",
}
settings = Settings(**mock_config)
settings = KeycloakSettings(**mock_config)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests that are associated with Keycloak portions should be removed from here now; and added to the api-commons tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, got it.

@@ -49,7 +49,7 @@ async def create_institution(
fi: FinancialInstitutionDto,
):
db_fi = await repo.upsert_institution(request.state.db_session, fi)
kc_id = oauth2_admin.upsert_group(fi.lei, fi.name)
kc_id = OAuth2Admin.upsert_group(fi.lei, fi.name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed this one

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant removing the tests related to KeycloakSettings from regtech-user-fi-management repo completely, and add these tests to the regtech-api-commons repo at a later time (create a ticket for it, I think there might be a ticket already about adding tests and coverage to that repo)

Copy link
Collaborator

@lchen-2101 lchen-2101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lchen-2101 lchen-2101 merged commit aa0c23b into main Jan 26, 2024
3 checks passed
@lchen-2101 lchen-2101 deleted the features/88_incorporate_regtech_api_commons_library branch January 26, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorporate regtech api commons library
3 participants