-
Couldn't load subscription status.
- Fork 11
refactor: permissions system rewrite #942
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
Merged
Merged
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
83a8712
refactor:
08ebc9d
refactor: update basePath resolution for development and production
cafc7e3
refactor: add key folder with test key json file
4b2a4c0
refactor: update comment in env.development
68983f0
refactor: cleanup module imports
c09df28
refactor: integrate with header and cookie strategy, add key path, an…
071d727
refactor: revert myservers-base to original state
67ebd79
fix: use original configuration for super and key string
fed11a1
refactor: remove config from super
6ded943
test: add tests for auth service methods and update paths test
c940212
Merge branch 'main' into refactor/permissions-system-rewrite
22a1be3
test: add tests for the api-key service
978bdc4
test: add auth resolver tests
4e48056
refactor: remove un-needed api-key entity
1f81a0d
fix: fix linting error
e6f4194
refactor: add better error handling to header strategy and fix model …
62a3e9e
refactor: check for valid user in validateCookiesCasbin
fc25e1b
refactor: add additional check for existence of roles
42bd3df
refactor: add error handling to syncApiKeyRoles
ddd4ffd
refactor: add input validation to addRoleToApiKey and removeRoleToApiKey
c1247e4
refactor: add role validation and error handling to addRoleToUser
060d28c
refactor: Add input validation and duplicate checking for permission …
567ceb0
refactor: handle undefined roles in validateApiKeyCasbin method
d024bd4
refactor: add error handling to ensureUserRoles method
ba4d1f5
refactor: add consistent error handling to all menthods in auth.service
5348d75
refactor: update addRoleToApiKey and removeRoleFromApiKey to fix fail…
4bd1902
refactor: update error handling to propagate correctly
1163afd
refacter: remove key from ApiKey response and add ApiKeyWithSecret ty…
9686677
refactor: handle errors when reading the API key directory
24cff2c
refactor: use async file system methods in api-key.service and update…
61d1719
refactor: use GraphQLError instead of internalServerErrorException
c8840c6
fix: use correct import for import GraphQLError
c1c31f8
refactor: use named imports for fs
a9df921
test: fix the mocked named imports
ef3a230
refactor: implement atomic role synchronization
f235e4d
test: use beforeEach instead of beforeAll
549b429
refactor: differentiate between not found and read error in findById
d80de68
feat: add nestjs/throttler package and apply rate limit to auth resol…
fdc2d5d
test: add additional tests for file read errors
dc640a1
refactor: remove apikey.graphql and refactor for new api key types
a8627cc
refactor: improve ENOENT error detection
cd6b82f
refactor: add Roles enum to auth.graphql
058d312
refactor: address issue with enum values in tests and update findByKey
2074cba
refactor: update all tests to use Role enum and remove UsersService
0ba6d3c
refactor: add role enum to input types
20bcace
fix: use update instead of create for add permission resolver
467d679
refactor: add enums for possession, action, and resources
c2236b3
refactor: use mockResolvedValue for async getSessionUser method.
43d491c
refactor: add Action to AddPermissionInput
5b214e0
refactor: add security enhancements to api-key service and use ID in …
71f1725
Merge branch 'main' into refactor/permissions-system-rewrite
5eff4ee
fix: update header.strategy to work with config passed to super
124003e
refactor: sanitize error logging in header.strategy
2c65e4e
fix: get auth module back to iriginal state before conflict
17c3aaf
chore: add generated files including package lock
fd3c66d
Merge branch 'main' into refactor/permissions-system-rewrite
elibosley ab4f249
fix: remove unused reflector decorator
elibosley 18864c5
feat: remove useGuard call
elibosley 5f3272d
fix: remove ACGuard from auth module as global provider and remove u…
c03d724
fix: throw exceptions for failed validations in header.strategy
92f73bf
feat: add custom fastify throttler and use in app.module
598745f
fix: update vite.config and fastify imports to fix nestjs dependency …
98bfcf7
fix: issue with undefined user and permisisons not working
c314997
refactor: add possession to usePermissions decorator in auth resolver
cc65302
fix: update AuthZModule initializer to handle the action:possession f…
1321176
refactor: Improve user context extraction robustness
0cb3f46
refactor: Remove resolver-level error handling to maintain consistency
a373279
refactor: trim name and use in api ket create method
e17b9c0
refactor: use lowercase enums and builtins to match authz defaults an…
a755045
refactor: address comments and update tests to match changes
256cc74
refactor: replace UseRole with UsePermissions in resolvers
b0e07d4
refactor: address comments and create casbin service and module
144e487
refactor: standardize auth error handling, add casbin files and remov…
65c455a
refactor: update error handling for coderabbit suggestions
61dd6fd
refactor: remove redundant coderabbit suggestion
32f9dc5
fix: move catch block to correct location
7fdd132
refactor: add sanitization, remove included string to handleAuthError…
a88c68e
Merge branch 'main' into refactor/permissions-system-rewrite
bb9b3f3
feat: Add local API key listener module
72bd918
feat: Add local API key listener with axios HTTP request to NestJS se…
208e5d5
refactor: add localApiKey creation during connect sign in and add lis…
74f3e6d
test: update tests with new localApiKey property
1602b0a
test: add localApiKey property to config test
5a24bde
refactor: add possession own to connect role
4bf4111
refactor: utilize the updateObject function within handleAuthError
5f19c5a
refactor: ensure localApiKey is valid before proceeding
51a08de
refactor: add input sanitization for the name parameter
dfe7a70
refactor: address code review comments
da4a2f3
fix: update own possession to any to work around nestjs-authz bug
8566a29
fix: add development env check to key validation in listener and add …
770e982
refactor: check for exsisting localApiKey to prevent multiple key cre…
4e5e50f
Merge branch 'main' into refactor/permissions-system-rewrite
7d525bf
fix: remove extra imports from conflict
86f0b32
fix: use appropriate error type and use structuredClone in utilty met…
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ typings/ | |
|
|
||
| # Visual Studio Code workspace | ||
| .vscode/sftp.json | ||
| .history/ | ||
|
|
||
| # OSX | ||
| .DS_Store | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "id": "10f356da-1e9e-43b8-9028-a26a645539a6", | ||
| "key": "73717ca0-8c15-40b9-bcca-8d85656d1438", | ||
| "name": "Test API Key", | ||
| "description": "Testing API key creation", | ||
| "roles": ["guest", "upc"], | ||
| "createdAt": "2024-10-29T19:59:12.569Z" | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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.