8000 (PXP-8994): Populate mapping table for existing users by johnfrancismccann · Pull Request #995 · uc-cdis/fence · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

(PXP-8994): Populate mapping table for existing users #995

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&rd 8000 quo;, 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

Conversation

johnfrancismccann
Copy link
Contributor

Jira Ticket: PXP-8994

Populate iss_sub_pair_to_user table using User table's id_from_idp column. Population of User table's id_from_idp column began with the 2021.12 release, which included this related PR.

New Features

  • Populate iss_sub_pair_to_user table using User table's id_from_idp column

@github-actions
Copy link
github-actions bot commented Jan 3, 2022

The style in this PR agrees with black. ✔️

This formatting comment was generated automatically by a script in uc-cdis/wool.

@coveralls
Copy link
coveralls commented Jan 3, 2022

Pull Request Test Coverage Report for Build 12162

  • 28 of 31 (90.32%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 72.554%

Changes Missing Coverage Covered Lines Changed/Added Lines %
fence/models.py 23 26 88.46%
Totals Coverage Status
Change from base Build 12159: 0.07%
Covered Lines: 6704
Relevant Lines: 9240

💛 - Coveralls

from fence.config import config, DEFAULT_CFG_PATH
from fence.settings import CONFIG_SEARCH_FOLDERS

try:
Copy link
Contributor

Choose a reason for hiding this comment

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

what prompted this, did you run into a specific issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

the gen3config library should handle all this complexity with this call

fence/fence/__init__.py

Lines 328 to 332 in 57672f2

config.load(
config_path=config_path,
search_folders=CONFIG_SEARCH_FOLDERS,
file_name=file_name,
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah so the issue with not loading the config here was that oidc = config.get("OPENID_CONNECT", {}) in _get_issuer_to_idp evaluated to an empty dictionary since _get_issuer_to_idp is called when fence/models.py is imported (which happens before app_config runs).

The if os.environ.get("FENCE_CONFIG_PATH"): check is to handle loading test-fence-config.yaml when the tests are being run.

Like you're saying, though, I think this can be simplified by putting:

config.load(
    config_path=os.environ.get("FENCE_CONFIG_PATH"),
    search_folders=CONFIG_SEARCH_FOLDERS
)

in place of the whole try/except.

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha, yeah I'd rather contain this logic within the gen3config library, so changing to that .load call would make me feel better

@johnfrancismccann johnfrancismccann merged commit 0efaf3b into feat/passport Jan 14, 2022
@johnfrancismccann johnfrancismccann deleted the chore/populate-iss-sub-pair-to-user-mapping-table branch January 14, 2022 19:34
@johnfrancismccann johnfrancismccann mentioned this pull request Jan 14, 2022
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0