client

package
v0.0.0-...-54c2f7d Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: CC0-1.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	ClientID     string
	ClientSecret string
	ClientName   string
}

type SSASClient

type SSASClient struct {
	http.Client
	// contains filtered or unexported fields
}

SSASClient is a client for interacting with the System-to-System Authentication Service.

func NewSSASClient

func NewSSASClient() (*SSASClient, error)

NewSSASClient creates and returns an SSASClient.

func (*SSASClient) CallSSASIntrospect

func (c *SSASClient) CallSSASIntrospect(tokenString string) ([]byte, error)

CallSSASIntrospect verifies that the tokenString presented was issued by the public server. It does so using the introspect endpoint as defined by https://tools.ietf.org/html/rfc7662

func (*SSASClient) CreateGroup

func (c *SSASClient) CreateGroup(groupId, name, acoCMSID string) ([]byte, error)

CreateGroup POSTs to the SSAS /group endpoint to create a system. Note, the groupId is not the same ID that is returned. ID is generated by the system.

func (*SSASClient) CreateSystem

func (c *SSASClient) CreateSystem(clientName, groupID, scope, publicKey, trackingID string, ips []string) ([]byte, error)

CreateSystem POSTs to the SSAS /system endpoint to create a system.

func (*SSASClient) DeleteCredentials

func (c *SSASClient) DeleteCredentials(systemID string) error

DeleteCredentials DELETEs from the SSAS /system/{systemID}/credentials endpoint to deactivate credentials associated with the system.

func (*SSASClient) DeleteGroup

func (c *SSASClient) DeleteGroup(id int) error

DeleteGroup DELETEs to the SSAS /group/{id} endpoint to delete a group.

func (*SSASClient) GetPublicKey

func (c *SSASClient) GetPublicKey(systemID int) ([]byte, error)

GetPublicKey GETs the SSAS /system/{systemID}/key endpoint to retrieve a system's public key.

func (*SSASClient) GetToken

func (c *SSASClient) GetToken(credentials Credentials, r http.Request) (string, error)

GetToken POSTs to the public SSAS /token endpoint to get an access token for a BCDA client

func (*SSASClient) GetVersion

func (c *SSASClient) GetVersion() (string, error)

GetVersion Gets the version of the SSAS client

func (*SSASClient) Ping

func (c *SSASClient) Ping() error

func (*SSASClient) ResetCredentials

func (c *SSASClient) ResetCredentials(systemID string) ([]byte, error)

ResetCredentials PUTs to the SSAS /system/{systemID}/credentials endpoint to reset the system's secret.

func (*SSASClient) RevokeAccessToken

func (c *SSASClient) RevokeAccessToken(tokenID string) error

RevokeAccessToken DELETEs to the public SSAS /token endpoint to revoke the token

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   string `json:"expires_in,omitempty"`
	TokenType   string `json:"token_type"`
}

Jump to

Keyboard shortcuts

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