• v1.1.0 8710f99b3f

    Rene Nochebuena released this 2026-08-12 15:49:37 -06:00 | 10 commits to main since this release

    v1.1.0

    code.nochebuena.dev/einherjar/contracts

    Overview

    contracts v1.1.0 adds the request-scoped security.SecurityBag and anchors the coordinated
    framework release at v1.1.0. Additive and non-breaking — existing Identity flows are
    unchanged; consumers that need to carry extra request-scoped attributes alongside the
    authenticated Identity adopt SecurityBag.

    Architecture Decisions Resolved

    Decision Resolution
    Request-scoped security context SecurityBag — carries Identity + typed attributes; immutable value type; replaces bare Identity propagation.

    Full API

    security (added)

    // SecurityBag — immutable request-scoped security context
    type SecurityBag struct { /* unexported fields */ }
    
    func NewSecurityBag(id Identity) SecurityBag
    func (b SecurityBag) Identity() Identity
    func (b SecurityBag) WithIdentity(id Identity) SecurityBag
    func (b SecurityBag) Get(key string) (any, bool)
    func (b SecurityBag) With(key string, value any) SecurityBag
    
    func SetBagInContext(ctx context.Context, bag SecurityBag) context.Context
    func BagFromContext(ctx context.Context) (SecurityBag, bool)
    

    Installation

    go get code.nochebuena.dev/einherjar/contracts@v1.1.0
    
    Downloads