-
Notifications
You must be signed in to change notification settings - Fork 37
[MDS-6681] MineSpace User Access Login flow #3803
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
base: develop
Are you sure you want to change the base?
Conversation
| id={props.id ?? props.input.name} | ||
| onSearch={debouncedSearch} | ||
| options={data} | ||
| value={input.value === "" ? [] : input.value} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had weird issues with the mines not being pre-populated from the form values and had to make this change. In making this change, I had to manually apply the aria-required (a bunch of snapshot tests showed it being removed. Now it added in a few aria-required=false but I'm okay with that)
| return user_emails | ||
|
|
||
| @staticmethod | ||
| def get_roles_by_user(username: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New functions can be used to handle any keycloak role management! If we wanted to give CORE users roles from within the app...
| * CORE/IDIR users are authenticated programmatically when MineSpace mounts, | ||
| */ | ||
|
|
||
| export const AuthenticationGuard = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was really just typescripted. No effort made to improve it otherwise (probably wouldn't use window.location)
| import * as Strings from "@mds/common/constants/strings"; | ||
| import PropTypes from "prop-types"; | ||
| // Uncomment when image is re-introduced | ||
| // import { MAP_LOGO } from "@/constants/assets"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a lot of stuff in this file that was basically half-implemented, in testing only functionality that was either commented out, or only available on test.
I removed all of that. If we want to implement logging in with verifiable credentials or whatever was going on with the commented out stuff, we'll do that properly.
|
|
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a new self-service user access request flow for MineSpace, where BCeID users can submit access requests through a comprehensive form. The system saves access request data to the database and manages Keycloak role assignments. Key features include:
Changes:
- New landing page with updated design and "Join MineSpace" functionality
- Self-service access request form for new MineSpace users with authorization workflow
- Backend API endpoints for managing user access requests and document uploads
- Feature flag controlled rollout (
MINESPACE_SIGNUP)
Reviewed changes
Copilot reviewed 90 out of 91 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| services/minespace-web/src/components/pages/MinespaceAccessRequest.tsx | New access request form component with Terms of Use and Privacy Notice |
| services/minespace-web/src/components/pages/LandingPage.tsx | Redesigned landing page with feature flag support for new signup flow |
| services/minespace-web/src/HOC/AuthenticationGuard.tsx | Updated authentication logic to store user access data from Keycloak |
| services/document-manager/backend/app/docman/resources/document.py | Added authorization bypass for minespace access request document uploads |
| services/core-web/src/components/admin/MinespaceUserAccessModal.tsx | Admin interface for reviewing and approving access requests |
| services/core-api/tests/users/resources/test_new_minespace_user_resource.py | Comprehensive test coverage for new API endpoints |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <Typography.Paragraph>Typical processing time: 5-10 business days</Typography.Paragraph> | ||
| <Typography.Paragraph strong>What you'll need:</Typography.Paragraph> | ||
| <ul> | ||
| <li>Your role and associated business name (as registered with Business BCeiD)</li> |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: "BCeiD" should be "BCeID" (lowercase 'e') to match the official branding and other instances in the codebase.
| const clientRoles = token?.client_roles || []; | ||
|
|
||
| if (keycloak.authenticated && !authenticationInProgressFlag && !type) { | ||
| localStorage.setItem("authenticationInProgressFlag", "true"); |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The localStorage flag is being set to the string "true" but checked as a truthy value. Consider using boolean true instead, or ensure the check elsewhere handles string "true" properly. Inconsistent types can lead to bugs.
|
|
||
| assert user is not None | ||
| assert user.bceid_username == bceid_username | ||
| assert user.deleted_ind == None |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing for None should use the 'is' operator.
| current_app.logger.info('Existing Mine: {}'.format(existing_minespace_user_mine)) | ||
| if not existing_minespace_user_mine: | ||
| new_minespace_user_mine = MinespaceUserMine.create(user_id, mine.mine_guid) | ||
| new_minespace_user_mine = MinespaceUserMine.create(user_id, mine.mine_guid) |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable new_minespace_user_mine is not used.
| new_minespace_user_mine = MinespaceUserMine.create(user_id, mine.mine_guid) | |
| MinespaceUserMine.create(user_id, mine.mine_guid) |
| mine2 = MineFactory() | ||
|
|
||
| # complete permittee form submission with mines | ||
| request = MinespaceUserRequest.create_or_update_request( |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable request is not used.
| from app.api.users.minespace.models.minespace_user_request import MinespaceUserRequest | ||
| # Import these models to ensure they're registered with SQLAlchemy (avoid circular import issues) | ||
| from app.api.users.minespace.models.minespace_user_role_xref import MinespaceUserRoleXref | ||
| from app.api.users.minespace.models.minespace_user_roles import MinespaceUserRole |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'MinespaceUserRole' is not used.
| @@ -0,0 +1,164 @@ | |||
| from datetime import datetime | |||
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'datetime' is not used.
| @@ -0,0 +1,164 @@ | |||
| from datetime import datetime | |||
| from pytz import utc | |||
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'utc' is not used.
| from app.api.utils.models_mixins import SoftDeleteMixin, Base | ||
|
|
||
|
|
||
| class MinespaceUserDocumentXref(SoftDeleteMixin, Base): |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base classes have conflicting values for attribute 'delete': Function delete and Function delete.
| from app.api.utils.models_mixins import SoftDeleteMixin, AuditMixin, Base | ||
|
|
||
|
|
||
| class MinespaceUserRoleXref(SoftDeleteMixin, AuditMixin, Base): |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base classes have conflicting values for attribute 'delete': Function delete and Function delete.




Objective
MDS-6681