jcorry / jcorry/morellis

Revisit isolation of Bearer token

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Go
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Description

This seems error prone. Can you check the type of `Authorization` header as well? I know it will throw an unauthorized error if the length is not as expected which could be enough but just food for thought.

Maybe something like:
```go
if len(bearerToken) == 2 && strings.Contains(bearerToken[0], "Bearer") {
```

_Originally posted by @syntacticNaCl in https://github.com/jcorry/morellis/pull/33_

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect the current Authorization-header and bearer-token handling, then review the context from pull request #33. Confirm how the header scheme and token length are validated, and consider the work done when malformed or non-Bearer headers consistently produce the intended unauthorized response.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.