-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add support for authz lookup #1196
Add support for authz lookup #1196
Conversation
Reviewer's Guide by SourceryThis pull request implements authorization checks for GridFTP operations based on user, project, and record permissions. It introduces a new authorization lookup mechanism and adds corresponding unit tests. Sequence diagram for GridFTP authorization flowsequenceDiagram
actor Client
participant Router as AuthZ Router
participant Repo as Repo Class
participant AuthZ as AuthZ Module
Client->>Router: GET /gridftp
Note over Router: Validate request params
Router->>Router: Get client info
Router->>Repo: new Repo(repo)
Router->>Repo: pathType(file)
Repo-->>Router: PathType result
alt PathType is UNKNOWN
Router-->>Client: Permission Denied
else Valid PathType
Router->>AuthZ: Check authz_strategy
AuthZ->>AuthZ: Execute strategy function
alt Authorization Successful
AuthZ-->>Router: Success
Router-->>Client: Authorized
else Authorization Failed
AuthZ-->>Router: Throw Permission Denied
Router-->>Client: Permission Denied
end
end
Class diagram for the new Repo class and PathType enumclassDiagram
class Repo {
-error: number
-err_msg: string
-exists: boolean
-repo_id: string
-repo_key: string
+constructor(a_key: string)
+exists(): boolean
+key(): string
+id(): string
+error(): number
+errorMessage(): string
+pathType(a_path: string): PathType
}
class PathType {
<<enumeration>>
USER_PATH
USER_RECORD_PATH
PROJECT_PATH
PROJECT_RECORD_PATH
REPO_BASE_PATH
REPO_ROOT_PATH
REPO_PATH
UNKNOWN
}
note for Repo "Handles repository path validation
and type classification"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @JoshuaSBrown - I've reviewed your changes - here's some feedback:
Overall Comments:
- There are some duplicated comments in the code, e.g. 'Will split a posix path into an array' appears twice. Consider cleaning these up for better maintainability.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
…to add-support-for-authz-lookup
@sourcery-ai review |
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.
Hey @JoshuaSBrown - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Remove comment that is not useful.
PR Description
Tasks
Summary by Sourcery
Implement authorization checks for data records and projects.
New Features:
Tests: