Skip to content

Conversation

@matt-codecov
Copy link
Contributor

@matt-codecov matt-codecov commented Dec 3, 2025

client implementations don't care about token content so these PRs are simple plumbing

i would still like to enable authz enforcement in our client e2e tests but this PR currently does not include that

Ref FS-202

@matt-codecov matt-codecov requested a review from a team as a code owner December 3, 2025 05:25
@matt-codecov matt-codecov force-pushed the matt/client-auth-impl branch from a962e6c to 7d0088d Compare December 4, 2025 01:31
@matt-codecov matt-codecov force-pushed the matt/client-auth-impl branch from 7d0088d to c6fefdd Compare December 4, 2025 01:35
Base automatically changed from branchless/pr199 to main December 4, 2025 16:00
@matt-codecov matt-codecov changed the base branch from main to matt/fix-authz-key-format December 5, 2025 03:21
@matt-codecov matt-codecov force-pushed the matt/client-auth-impl branch from c6fefdd to 440353c Compare December 5, 2025 03:21
Base automatically changed from matt/fix-authz-key-format to main December 5, 2025 10:44
Copy link
Member

@lcian lcian left a comment

Choose a reason for hiding this comment

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

LGTM, when we roll out the auth we should document that this is always required in saas, we can do so in a follow-up

* main:
  fix(auth): Require EdDSA and fix verification (#232)
  release: 0.0.14
  feat(server): Implement the new Web API (#230)
base_url: str,
metrics_backend: MetricsBackend | None = None,
propagate_traces: bool = False,
auth_token: str | None = None,
Copy link
Member

Choose a reason for hiding this comment

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

This requires the user to know too much about our auth mechanism and do too much manually. The follow-up PR shows this very well: https://github.com/getsentry/objectstore/pull/231/files#diff-2901f12558868d8df8503eb8c709ebe697eaf471057eabeadede4c292f869fbeR29-R59

Compare with the implementation we had initially for this, which just required to configure a secret, and the client did all the rest.

We should change it like so:

  • The client is configured with options it needs to create tokens itself
    • (mandatory) The private key. If missing, no tokens will be issued.
    • (optional) A set of permissions. Builder defaults this to all permissions.
    • (optional) An expiry duration (not timestamp!). Defaults to something reasonably short, like 60s.
  • The session is responsible to create the token
    • References above options from the client or gets them injected
    • Together with the session's usecase and scopes it builds the token
    • Applies it to all outgoing requests on the session.
  • Caching:
    • The token can be reused until it is close to expiry, session then regenerates it on-the-fly
    • In practice, this means the session initializes w/o a token and the first request creates it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i still disagree for all the reasons i've argued previously, but i will take your direction

@linear
Copy link

linear bot commented Dec 9, 2025

@matt-codecov
Copy link
Contributor Author

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.

4 participants