auth

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package auth configures the original Datly JWT verification contract for explicitly declared input codecs. It never injects an ambient principal.

Index

Constants

View Source
const JwtClaim = "JwtClaim"

Variables

This section is empty.

Functions

func VerifiesJWT

func VerifiesJWT(instance xcodec.Instance) bool

VerifiesJWT recognizes the configured codec actually constructed by Service. Names, marker interfaces, and unrelated codec implementations cannot assert this authority. No keys or verifier configuration are exposed.

Types

type ClaimPolicy added in v1.1.0

type ClaimPolicy struct {
	Issuer         string `json:"Issuer,omitempty" yaml:"Issuer,omitempty"`
	Audience       string `json:"Audience,omitempty" yaml:"Audience,omitempty"`
	RequireSubject bool   `json:"RequireSubject,omitempty" yaml:"RequireSubject,omitempty"`
}

ClaimPolicy binds a successfully verified JWT to the intended issuer, audience and principal. It is optional so existing Datly deployments retain their current verifier contract until they opt in.

type Config

type Config struct {
	JWTValidator *verifier.Config
	ClaimPolicy  *ClaimPolicy
}

Config retains the original Datly JWTValidator configuration, including CertURL and RSA public-key resources. Verification policy stays with Scy.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is an application-configured codec factory. Pass it through the existing bootstrap CodecFactory input; only declared JwtClaim inputs use it.

func New

func New(ctx context.Context, config *Config) (*Service, error)

func (*Service) New

func (s *Service) New(config *xcodec.Config, _ ...xcodec.Option) (xcodec.Instance, error)

Directories

Path Synopsis
Package provider composes statically linked authentication implementations.
Package provider composes statically linked authentication implementations.

Jump to

Keyboard shortcuts

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