iam

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package iam implements the AWS IAM query-protocol as a server.Handler. Point the real aws-sdk-go-v2 IAM client at a Server registered with this handler and User/Role/Policy/Group/AccessKey/InstanceProfile operations work against an in-memory iam driver.

IAM shares the AWS query wire shape with EC2, RDS, and Redshift (POST + form-encoded body, XML response). To keep dispatch unambiguous, this handler's Matches predicate parses the form body once and only claims requests whose Action is one of the known IAM operations. It MUST register before the EC2 catch-all so iam-specific actions aren't swallowed first.

Index

Constants

View Source
const Namespace = "https://iam.amazonaws.com/doc/2010-05-08/"

Namespace is the XML namespace for AWS IAM responses. Matches the real aws-sdk-go-v2 IAM client expectations (the SDK is namespace-agnostic on parse but copies this value back on round-trips).

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler serves IAM query-protocol requests.

func New

func New(drv iamdriver.IAM) *Handler

New returns an IAM handler backed by drv.

func (*Handler) Matches

func (*Handler) Matches(r *http.Request) bool

Matches returns true if the request looks like an AWS IAM query-protocol call (POST + form-encoded body whose Action is one of the known IAM operations). Calling ParseForm here caches the parsed form on the request so ServeHTTP can use it without re-reading the body.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP dispatches on Action. The form has already been parsed by Matches.

Jump to

Keyboard shortcuts

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