Skip to content

Renamed ClaimImpl.kt to JsonClaim.kt. Cached base64Decoder. Generated IMPROVEMENTS.md. - #2

Open
tberchanov wants to merge 3 commits into
mainfrom
improvements
Open

Renamed ClaimImpl.kt to JsonClaim.kt. Cached base64Decoder. Generated IMPROVEMENTS.md.#2
tberchanov wants to merge 3 commits into
mainfrom
improvements

Conversation

@tberchanov

Copy link
Copy Markdown

No description provided.

Comment thread IMPROVEMENTS.md

## 🚨 Critical Security Issues

### 1. No Signature Verification

Copy link
Copy Markdown
Member

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

Comment thread IMPROVEMENTS.md
fun verify(jwt: JWT): VerificationResult
}

sealed class VerificationResult {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sealed interface

Comment thread IMPROVEMENTS.md
```

### 2. No Algorithm Validation
**Current State**: No validation of the algorithm specified in the JWT header.

Copy link
Copy Markdown
Member

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?

Comment thread IMPROVEMENTS.md
### 3. No Input Validation
**Current State**: Accepts any string input without validation.

**Code Example**:

Copy link
Copy Markdown
Member

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?

Comment thread IMPROVEMENTS.md

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+/=_-]*)$")

Copy link
Copy Markdown
Member

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

Comment thread IMPROVEMENTS.md
### 16. Missing Sample Applications
**Current State**: No example applications demonstrating how to use the JWTDecode library.

**Missing Examples**:

Copy link
Copy Markdown
Member

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.

Comment thread IMPROVEMENTS.md

### 17. Add Key Management
**Implementation**:
```kotlin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of scope?

Comment thread IMPROVEMENTS.md
### 18. Add Streaming Support
**Implementation**:
```kotlin
// For large JWTs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of scope?

Comment thread IMPROVEMENTS.md
### 19. Add Batch Processing
**Implementation**:
```kotlin
interface JWTBatchProcessor {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not our responsibility.

Comment thread IMPROVEMENTS.md
## 🔄 Future-Proofing Areas

### 20. Add Plugin System
**Implementation**:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants