samltest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package samltest provides a deliberately small SAML IdP fixture for Hikyo's end-to-end tests. It produces real signed assertions; it is not a protocol implementation and must not be used outside tests.

Index

Constants

View Source
const (
	EntityID = "https://samltest.example/metadata"
	SSOURL   = "https://samltest.example/sso"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IdP

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

IdP owns the signing material used by one test identity provider.

func New

func New(now time.Time) (*IdP, error)

New creates a self-signed IdP certificate valid around now.

func (*IdP) Metadata

func (i *IdP) Metadata(now time.Time) []byte

Metadata returns unsigned metadata whose signing key is explicitly pinned by the provider configuration ceremony exercised by the caller.

func (*IdP) SignedMetadata

func (i *IdP) SignedMetadata(now time.Time) ([]byte, error)

SignedMetadata returns metadata self-signed by the fixture IdP. Callers still exercise the explicit first-seen fingerprint ceremony.

func (*IdP) SignedResponse

func (i *IdP) SignedResponse(config Response) (string, error)

SignedResponse returns a base64-encoded HTTP-POST SAMLResponse containing a signed Assertion and an unsigned Response envelope.

type Request

type Request struct {
	ID         string
	ForceAuthn bool
}

Request is the binding-relevant part of a Redirect AuthnRequest.

func DecodeRequest

func DecodeRequest(redirectURL string) (Request, error)

DecodeRequest reads the ID and ForceAuthn flag from a Redirect-binding URL.

type Response

type Response struct {
	RequestID    string
	ResponseID   string
	AssertionID  string
	ACSURL       string
	SPEntityID   string
	NameID       string
	NameIDFormat string
	AuthnContext string
	Now          time.Time
	Validity     time.Duration
}

Response describes the assertion fields a test wants to bind.

Jump to

Keyboard shortcuts

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