-
Notifications
You must be signed in to change notification settings - Fork 0
Add Entra app-role route authorization for initial ui-staff sections #239
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
Open
rohit-r-kumar
wants to merge
105
commits into
main
Choose a base branch
from
rohit-r-kumar/issue214
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
105 commits
Select commit
Hold shift + click to select a range
216b93a
Create @apps/ui-staff bootstrap app and compose initial staff route p…
ccd8d38
fix build issue
1787b54
feat: add ui-staff route packages with basic structure and vitest con…
ttrang-nguyen f7e70f9
feat(ui-staff): update routing and authentication structure
ttrang-nguyen 2c50239
add pnpm-lock.yaml
ttrang-nguyen cfa2563
feat: add uuid dependency to package.json and update pnpm-lock.yaml
ttrang-nguyen d92e935
feat: add AuthLanding component for navigation and Apollo client setup
ttrang-nguyen 9256b16
fix: update ApolloConnectionProps interface
ttrang-nguyen cb0f452
Update Snyk ignore rules for UUID and adjust package versions for com…
ttrang-nguyen e7d8ae1
update snyke ignore
ttrang-nguyen 19531b8
update layout and styling in ThemeProvider component
ttrang-nguyen c8d30de
fix: update dev script to use correct localhost domain
ttrang-nguyen 2355bed
merge from main and resolve merge issue
ttrang-nguyen 3385ed1
feat: integrate StaffAuthProvider for user identity management
ttrang-nguyen 0a7817f
update OIDC configuration and add mock data for staff authentication
ttrang-nguyen 0095df3
feat: implement login page and update routing for authentication
99e0148
fix merge conflicts
ttrang-nguyen 7124050
fix build issue
ttrang-nguyen daac62c
chore: update TypeScript to 6.0.3 and add native-preview package; mod…
cdcdab1
chore: update TypeScript version to 6.0.3 in pnpm-lock.yaml
be5783e
refine login page and add logout functionality
ttrang-nguyen d01e0fc
Merge branch 'rohit-r-kumar/issue212' of github.com:CellixJs/cellixjs…
ttrang-nguyen 49f66f8
remove dist files
ttrang-nguyen 37ad0c1
refactor: restructure authentication flow and remove login page compo…
e6c5e31
remove .env from .gitignore
ttrang-nguyen 78d2ac3
refactor: update build scripts to use tsgo and improve code formatting
ttrang-nguyen 280a381
refactor: update package.json scripts and remove unused dependencies
7a40958
refactor: update entry points and project patterns in knip.json and p…
47c125e
refactor: remove unused dependencies from pnpm-lock.yaml
c204df3
fix: correct token property name in ThemeProvider and adjust children…
ttrang-nguyen fedc557
fix: correct typo in OIDCConfig type and instance from 'noonce' to 'n…
ttrang-nguyen 29cdc6f
refactor: update environment variable references and improve type def…
ttrang-nguyen ba59183
format
ttrang-nguyen a67eb06
feat: integrate react-oidc-context for authentication in header compo…
ttrang-nguyen b4a3b77
Changes before error encountered
Copilot 13b4897
test: add unit tests for resolver-builder module and mergeResolvers f…
93df96e
Renaming: ui-community-route-shared -> ui-community-shared
7767f71
fix: rename ui-community-route-shared to ui-community-shared in knip.…
8912120
fix: correct Biome formatting in resolver-builder.test.ts
Copilot 27cb61e
feat(ui-staff): add Entra app-role route authorization (#214)
54d2f83
Merge branch 'main' of https://github.com/CellixJs/cellixjs into rohi…
ac69b4e
test(ui-staff): add route-authorization scenario tests for all 4 Entr…
440c022
chore(ui-staff-routes): remove unused deps flagged by knip
3bfe580
Revert package.json
f1e381a
test(ui-staff): add Playwright e2e tests for role-based route authori…
6396cd4
feat: update pnpm workspace and add new packages for Cucumber and Ser…
8bbf225
chore: remove react-dom version from pnpm-lock.yaml
08f44c3
Refactor code structure for improved readability and maintainability
a87bbfa
feat: implement theme storage functions and update theme context to u…
bf378d6
fix: refine theme context type and improve theme storage handling
085ed0f
fix: enhance theme context type and streamline theme storage handling
f51991e
fix: correct import order for theme storage functions in theme context
8f64ac2
feat: implement staff RBAC with backend user/role creation and permis…
d1b3d25
feat: add staff user query and permissions handling in community and …
a6f530f
feat: add staff user role csv file
ttrang-nguyen 56755b5
Merge branch 'rohit-r-kumar/issue214' of github.com:CellixJs/cellixjs…
ttrang-nguyen 9ce1e95
update staff role permissions and community list story
ttrang-nguyen 063dda5
refactor: update community permissions structure and related queries
ff79094
refactor: improve staff role permissions test structure and enhance t…
b2f97f7
refactor: remove default roleType from StaffRoleSchema
ttrang-nguyen 28ec3b6
Merge branch 'rohit-r-kumar/issue214' of github.com:CellixJs/cellixjs…
ttrang-nguyen 17f83e1
add mongoose vulnerability exception with detailed reasoning
6a053ba
feat: Add staff user resolvers and tests for querying and creating st…
fceac8e
Merge Branch with Main
56324cb
refactor: Simplify function definitions and improve readability in tests
7a81701
Refactor code structure for improved readability and maintainability
9bcf52b
refactor: Remove unused imports from theme context
be4b476
feat: Update staff route management and authorization roles for commu…
ttrang-nguyen 825c79a
feat: Implement role-based access control for staff routes and permis…
b9d03cc
feat: Implement role-based access control for staff routes and permis…
c0091c0
refactor: Rename VITE_FUNCTION_ENDPOINT to VITE_COMMON_API_ENDPOINT a…
fd13793
refactor: Rename VITE_FUNCTION_ENDPOINT to VITE_COMMON_API_ENDPOINT a…
a18025d
feat: Update dependencies for improved security and functionality
ttrang-nguyen 53cdd3e
feat: Enhance role-based access control in staff routes and permissions
ttrang-nguyen 2c6ff5e
Removed staff-user-role csv file, refactored createDefaultRoles, upda…
ttrang-nguyen 7af12a2
fix snyk issue
ttrang-nguyen 227fe04
e2e and acceptance-ui tests for staff
ttrang-nguyen 564144a
update tests
ttrang-nguyen c37714e
chore: update protobufjs to resolved snyk issue
2134ac4
refactor: replace withScopedTransaction with withTransaction in staff…
5a492a6
feat: implement StaffUserUserPassport and update StaffUserPassport to…
6202fd1
Added TechAdmin permission to finance, community-management, and user…
ttrang-nguyen ef09d6d
downgrade packageManager to pnpm@10.30.1, add canManage permissions s…
ttrang-nguyen 5b4b7e3
chore: update protobufjs to version 7.5.8
ttrang-nguyen 3741499
feat: enhance staff role management by adding default role instances …
850330a
add query for fetching displayName
ttrang-nguyen 7c8cac6
remove staff queries from ui-community route
ttrang-nguyen 01559d7
Merge branch with main
daf83d3
Resolve conflicts
f0307ed
conflicts
ttrang-nguyen 0aca918
merge conflicts
ttrang-nguyen 3994cc7
undo and resolve conflicts
ttrang-nguyen c6457e5
update role names nad remove unused staff section permissions
ttrang-nguyen cb05fc9
Merge branches 'rohit-r-kumar/issue214' and 'rohit-r-kumar/issue214' …
5d0a3d1
feat(staff-role): add support for retrieving default roles by enterpr…
ttrang-nguyen 1583df2
Merge branch 'rohit-r-kumar/issue214' of github.com:CellixJs/cellixjs…
ttrang-nguyen 6973a3b
Revert "Merge branch 'rohit-r-kumar/issue214' of github.com:CellixJs/…
ttrang-nguyen de9ecf9
Fix knip issues
9cc7d56
Merge branch 'main' of https://github.com/CellixJs/cellixjs into rohi…
a287666
refactor: update staff role handling and remove unused queries in com…
ce38a55
remove uuid and add enterpriseAppRole for finance and techAdmin
ttrang-nguyen e2161c4
feat: add enterpriseAppRole handling in staff role tests and repository
7c69013
Resolve test coverage failure and add getDefaultRoleByEnterpriseAppRole
ttrang-nguyen 0960b11
chore: update dependencies for snyk issue
ttrang-nguyen 7ddca09
remove staffPermission from index.tsx
ttrang-nguyen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 38 additions & 1 deletion
39
apps/ui-staff/src/components/ui/molecules/auth-landing/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,42 @@ | ||
| import { Spin } from 'antd'; | ||
| import { Navigate } from 'react-router-dom'; | ||
| import { useStaffPermissions } from '../../../../hooks/use-staff-permissions.ts'; | ||
|
|
||
| export const AuthLanding: React.FC = () => { | ||
| return <Navigate to="/staff/community-management" />; | ||
| const { permissions, loading, error } = useStaffPermissions(); | ||
|
|
||
| if (loading) { | ||
| return ( | ||
| <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh' }}> | ||
| <Spin size="large" /> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| if (error) { | ||
| return ( | ||
| <Navigate | ||
| to="/unauthorized" | ||
| replace | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| let targetRoute = '/unauthorized'; | ||
| if (permissions?.canManageTechAdmin) { | ||
| targetRoute = '/staff/tech'; | ||
| } else if (permissions?.canManageFinance) { | ||
| targetRoute = '/staff/finance'; | ||
| } else if (permissions?.canManageCommunities) { | ||
| targetRoute = '/staff/community-management'; | ||
| } else if (permissions?.canManageUsers) { | ||
| targetRoute = '/staff/user-management'; | ||
| } | ||
|
|
||
| return ( | ||
| <Navigate | ||
| to={targetRoute} | ||
| replace | ||
| /> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.