testscim

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package testscim is a SCIM 2.0 service provider for AuthKit's provisioning tests: users in memory, every request recorded, failures on demand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Method, Path string
	Query        url.Values
	Body         []byte
}

Request is one request the server answered.

type Server

type Server struct {
	Token    string
	PageSize int
	FailWhen func(*http.Request) bool
	// contains filtered or unexported fields
}

Server holds users by the id it gives them. Token, when set, is the bearer token it requires; PageSize, when set, is the most users a list answers; FailWhen, when it returns true, answers a request 503.

func New

func New(bulk bool, maxOps int) *Server

New is a server; bulk advertises and serves /Bulk with maxOps operations per request.

func (*Server) Add

func (s *Server) Add(u scim.User) string

Add stores u as if another client had created it.

func (*Server) Edit

func (s *Server) Edit(id string, edit func(*scim.User))

Edit changes the user whose externalId is id behind AuthKit's back.

func (*Server) FailNext

func (s *Server) FailNext(n int)

FailNext answers the next n requests 503.

func (*Server) Len

func (s *Server) Len() int

Len is how many users the server holds.

func (*Server) Remove

func (s *Server) Remove(id string)

Remove deletes the user whose externalId is id behind AuthKit's back.

func (*Server) Requests

func (s *Server) Requests() []Request

Requests are the requests answered so far.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) User

func (s *Server) User(id string) (scim.User, bool)

User is the user whose externalId is id.

Jump to

Keyboard shortcuts

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