[MDS-6681] MineSpace User Access Login flow#3803
Conversation
| id={props.id ?? props.input.name} | ||
| onSearch={debouncedSearch} | ||
| options={data} | ||
| value={input.value === "" ? [] : input.value} |
There was a problem hiding this comment.
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.
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.
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.
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.
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> |
There was a problem hiding this comment.
Spelling error: "BCeiD" should be "BCeID" (lowercase 'e') to match the official branding and other instances in the codebase.
There was a problem hiding this comment.
it actually means that the "i" should be uppercase. 😅
Fixing
|
|
||
| assert user is not None | ||
| assert user.bceid_username == bceid_username | ||
| assert user.deleted_ind == None |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Variable request is not used.
services/core-api/app/api/users/minespace/resources/new_minespace_user.py
Show resolved
Hide resolved
| @@ -0,0 +1,164 @@ | |||
| from datetime import datetime | |||
There was a problem hiding this comment.
Import of 'datetime' is not used.
| @@ -0,0 +1,164 @@ | |||
| from datetime import datetime | |||
| from pytz import utc | |||
There was a problem hiding this comment.
Import of 'utc' is not used.
services/core-api/app/api/users/minespace/models/minespace_user_document_xref.py
Show resolved
Hide resolved
services/core-api/app/api/users/minespace/models/minespace_user_role_xref.py
Show resolved
Hide resolved
|
|
|
|




Objective
More specific behaviour:
MS Landing Page
(must be logged in and submit BCeID info in order to create request)
MS Access Request Form
minespace_user_requestrecord with the request_status of 0/pendingminespace_userrecord is also created. Nominespace_user_mds_mine_acessthoughCore MineSpace Management
minespace_userrecord is now soft deletedCore: MineSpace User Access Modal Form
MDS-6681
MS Landing page:
HEADER BAR: Note that this is a global change.
Logged in header bar:

MS Request Access Form:




After Submitting (will show after log out/in again as well):

Core MineSpace Users:
Core: MineSpace User Access Modal Form


