revocation

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 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 revocation keeps the set of revoked relay-minted tokens. The control plane adds a token id with the token's expiry to one list in the shared store; every pod holds a copy it re-reads on an interval and checks in memory, so the request path makes no store call for it. A revoked token stays denied until its own expiry, when it would fail anyway, and the entry is dropped.

Scope: the list, its in-memory copy and the poll. Out of scope: who may revoke (control API), the bulk sign-out through a user's token version (plans), and the signature check.

Expected kv ops: none per request; one GET per pod per poll; one locked GET and SET per revocation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type List

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

List is the shared list and this pod's copy of it.

func New

func New(store Store) *List

New returns a list over store with an empty copy; Refresh or Run fills it.

func (*List) Refresh

func (l *List) Refresh(ctx context.Context) error

Refresh replaces this pod's copy with the shared list, keeping the ids this pod revoked that the read does not hold yet.

func (*List) Revoke

func (l *List) Revoke(ctx context.Context, id string, exp time.Time) error

Revoke adds token id, valid until exp, to the shared list and to this pod's copy. A token already past exp is not recorded.

func (*List) Run

func (l *List) Run(ctx context.Context, every time.Duration)

Run refreshes the copy every interval until ctx ends. A failed read keeps the previous copy: revocations made meanwhile land on the next good read.

func (*List) Set

func (l *List) Set() *Set

Set returns the copy the request path reads.

type Set

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

Set is the in-memory copy the request path reads.

func (*Set) Revoked

func (s *Set) Revoked(id string, now time.Time) bool

Revoked reports whether token id is revoked and not yet past its expiry at now.

type Store

type Store interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
	WithLock(ctx context.Context, keys []string, fn func(context.Context) error) error
}

Store is the slice of kv.Store the list uses.

Jump to

Keyboard shortcuts

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