Documentation

Index

Constants

View Source
const (
	// TokenPath is url path for handling STS requests.
	TokenPath = "/token"
	// StsStatusPath is the path for dumping STS status.
	StsStatusPath = "/stsStatus"
	// URLEncodedForm is the encoding type specified in a STS request.
	URLEncodedForm = "application/x-www-form-urlencoded"
	// TokenExchangeGrantType is the required value for "grant_type" parameter in a STS request.
	TokenExchangeGrantType = "urn:ietf:params:oauth:grant-type:token-exchange"
	// SubjectTokenType is the required token type in a STS request.
	SubjectTokenType = "urn:ietf:params:oauth:token-type:jwt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LocalHostAddr string
	LocalPort     int
}

    Config for the STS server.

    type Server

    type Server struct {
    
    	// Port number that server listens on.
    	Port int
    	// contains filtered or unexported fields
    }

      Server watches HTTP requests for security token service (STS), and returns token in response.

      func NewServer

      func NewServer(config Config, tokenManager security.TokenManager) (*Server, error)

        NewServer creates a new STS server.

        func (*Server) DumpStsStatus

        func (s *Server) DumpStsStatus(w http.ResponseWriter, req *http.Request)

          DumpStsStatus handles requests for dumping STS status, including STS requests being served, tokens being fetched.

          func (*Server) ServeStsRequests

          func (s *Server) ServeStsRequests(w http.ResponseWriter, req *http.Request)

            ServeStsRequests handles STS requests and sends exchanged token in responses.

            func (*Server) Stop

            func (s *Server) Stop()

              Stop closes the server

              Source Files