authctx

package
v0.0.1-dev.137 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package authctx provides a small shared context-key registry so that gRPC service handlers (under pkg/api/service) can read the authenticated subject stamped onto the context by the server-side auth interceptor (under pkg/api/server) without creating an import cycle.

The server interceptor calls WithSubject; service handlers call SubjectFrom.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SubjectFrom

func SubjectFrom(ctx context.Context) string

SubjectFrom returns the subject ID previously attached via WithSubject, or the empty string if none is present.

func WithSubject

func WithSubject(ctx context.Context, subjectID string) context.Context

WithSubject returns a derived context that carries the given subject ID. The subject ID is the canonical identifier for the authenticated principal, typically the user ID stored on the verified token.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL