scimext

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package scimext provides a Go client for the SCIM Agent Extension API.

EXPERIMENTAL: This package implements draft-abbey-scim-agent-extension-00 which is still under development. The API may change as the specification evolves.

Overview

The SCIM Agent Extension adds two new resource types to SCIM 2.0:

  • Agent: Represents AI agents with their own identity, metadata, and privileges
  • AgenticApplication: Represents applications that host or provide access to agents

This extension enables identity providers and service providers to manage agents using the well-established SCIM protocol, rather than requiring adoption of entirely new agent discovery and management protocols.

Key Components

  • Client: Main entry point for interacting with SCIM servers
  • agents.Service: Operations on Agent resources (/Agents endpoint)
  • applications.Service: Operations on AgenticApplication resources (/AgenticApplications endpoint)

Example Usage

client, err := scimext.NewClient(
    scimext.WithBaseURL("https://scim.example.com/v2"),
    scimext.WithBearerToken(os.Getenv("SCIM_TOKEN")),
)
if err != nil {
    log.Fatal(err)
}

// Create an agent
agent, err := client.Agents().Create(ctx, &agents.CreateRequest{
    Name:        "my-ai-assistant",
    DisplayName: "My AI Assistant",
    AgentType:   "Assistant",
    Active:      true,
})
if err != nil {
    log.Fatal(err)
}
fmt.Printf("Created agent: %s\n", agent.ID)

// List all agents
list, err := client.Agents().List(ctx, nil)
if err != nil {
    log.Fatal(err)
}
for _, a := range list.Resources {
    fmt.Printf("Agent: %s (%s)\n", a.Name, a.ID)
}

References

Index

Constants

View Source
const Version = "0.1.0"

Version is the SDK version.

Variables

View Source
var (
	ErrNotFound     = errors.New("scimext: resource not found")
	ErrUnauthorized = errors.New("scimext: unauthorized")
	ErrForbidden    = errors.New("scimext: forbidden")
	ErrConflict     = errors.New("scimext: conflict")
	ErrBadRequest   = errors.New("scimext: bad request")
)

Common errors returned by the SCIM client.

Functions

func IsBadRequest

func IsBadRequest(err error) bool

IsBadRequest returns true if the error indicates invalid input.

func IsConflict

func IsConflict(err error) bool

IsConflict returns true if the error indicates a conflict (e.g., duplicate resource).

func IsForbidden

func IsForbidden(err error) bool

IsForbidden returns true if the error indicates an authorization failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the error indicates a resource was not found.

func IsUnauthorized

func IsUnauthorized(err error) bool

IsUnauthorized returns true if the error indicates an authentication failure.

Types

type APIError

type APIError struct {
	StatusCode int
	SCIMType   string
	Detail     string
}

APIError represents an error returned by the SCIM API.

func (*APIError) Error

func (e *APIError) Error() string

Error implements the error interface.

type Client

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

Client provides access to the SCIM Agent Extension API.

func NewClient

func NewClient(opts ...Option) (*Client, error)

NewClient creates a new SCIM Agent Extension client.

func (*Client) API

func (c *Client) API() *api.Client

API returns the underlying ogen API client for advanced use cases.

func (*Client) Agents

func (c *Client) Agents() *agents.Service

Agents returns the agents service for managing Agent resources.

func (*Client) Applications

func (c *Client) Applications() *applications.Service

Applications returns the applications service for managing AgenticApplication resources.

type Option

type Option func(*clientOptions)

Option is a functional option for configuring the client.

func WithBaseURL

func WithBaseURL(url string) Option

WithBaseURL sets the base URL for the SCIM server.

func WithBearerToken

func WithBearerToken(token string) Option

WithBearerToken sets the bearer token for authentication.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the HTTP client to use for requests.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the timeout for HTTP requests.

Directories

Path Synopsis
Package agents provides operations for managing SCIM Agent resources.
Package agents provides operations for managing SCIM Agent resources.
Package applications provides operations for managing SCIM AgenticApplication resources.
Package applications provides operations for managing SCIM AgenticApplication resources.
examples
simple command
Package main demonstrates basic usage of the SCIM Agent Extension client.
Package main demonstrates basic usage of the SCIM Agent Extension client.
internal
api
Code generated by ogen, DO NOT EDIT.
Code generated by ogen, DO NOT EDIT.

Jump to

Keyboard shortcuts

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