-
Notifications
You must be signed in to change notification settings - Fork 0
Renamed ClaimImpl.kt to JsonClaim.kt. Cached base64Decoder. Generated IMPROVEMENTS.md. #2
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: main
Are you sure you want to change the base?
Conversation
|
|
||
| ## 🚨 Critical Security Issues | ||
|
|
||
| ### 1. No Signature Verification |
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.
Initially this repo has an exact purpose - decode tokens, just to be able to fetch parts from string and use it. As initial codebase was not great from the implementation point of view, we can proceed with better implementation. I'm going to create an issue for this: #3
| fun verify(jwt: JWT): VerificationResult | ||
| } | ||
|
|
||
| sealed class VerificationResult { |
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.
sealed interface
| ``` | ||
|
|
||
| ### 2. No Algorithm Validation | ||
| **Current State**: No validation of the algorithm specified in the JWT header. |
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.
Should this be a part of constructor and throw an exception?
| ### 3. No Input Validation | ||
| **Current State**: Accepts any string input without validation. | ||
|
|
||
| **Code Example**: |
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.
Sounds valid.
Question - use required in constructor or throw other exceptions?
|
|
||
| companion object { | ||
| private const val MAX_TOKEN_LENGTH = 8192 | ||
| private val TOKEN_PATTERN = Regex("^[A-Za-z0-9+/=_-]+\\.([A-Za-z0-9+/=_-]+)\\.([A-Za-z0-9+/=_-]*)$") |
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.
Explanation for non-regex friendly devs might be useful
| ### 16. Missing Sample Applications | ||
| **Current State**: No example applications demonstrating how to use the JWTDecode library. | ||
|
|
||
| **Missing Examples**: |
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.
android & iOS app are present, for other platforms we are gonna go when basic APIs gonna be stable.
|
|
||
| ### 17. Add Key Management | ||
| **Implementation**: | ||
| ```kotlin |
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.
out of scope?
| ### 18. Add Streaming Support | ||
| **Implementation**: | ||
| ```kotlin | ||
| // For large JWTs |
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.
out of scope?
| ### 19. Add Batch Processing | ||
| **Implementation**: | ||
| ```kotlin | ||
| interface JWTBatchProcessor { |
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.
Not our responsibility.
| ## 🔄 Future-Proofing Areas | ||
|
|
||
| ### 20. Add Plugin System | ||
| **Implementation**: |
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.
not needed
b0c4b3b to
87b4f76
Compare
… IMPROVEMENTS.md.
d6f99b9 to
49034c9
Compare
No description provided.