Documentation ¶
Index ¶
- Variables
- func CreateAgent(realm, agentName, payloadPath string) (err error)
- func CreateRealm(parentPath, realmName string, aliases ...string) (realmId string, err error)
- func CreateScript(realm string, config io.Reader) (err error)
- func CreateSecretMapping(secretID string, aliases []string) (err error)
- func CreateService(realm, serviceType string, config io.Reader) (err error)
- func CreateTree(realm, id string, config io.Reader) (err error)
- func CreateTreeNode(realm, nodeType, id string, config io.Reader) (err error)
- func DeleteAgent(realm string, agentName string) (err error)
- func DeleteIdentity() (err error)
- func DeleteRealm(realmId string) (err error)
- func DeleteScript(realm string, id string) (err error)
- func DeleteService(realm string, serviceName string) (err error)
- func DeleteTree(realm, id string) (err error)
- func DeleteTreeNode(realm, nodeType, id string) (err error)
- func GetAdvancedServerProperties() (properties map[string]interface{}, err error)
- func GetIdentity(realm, name string) ([]byte, error)
- func GetService(realm, name string) (response []byte, err error)
- func LogoutSession(token string) (err error)
- func OAuthBaseURL(amURL string, realmPath string, dnsConfigured bool) string
- func RevokeAccessToken(realm string, clientName string, clientPassword string, token string) error
- func SendUserConsent(realm string, user IdAttributes, userCode thing.DeviceAuthorizationResponse, ...) error
- func SetAdvancedServerProperties(properties map[string]interface{}) (err error)
- func URL(subDomain string) string
- func UpdateAgent(realm, agentName, payloadPath string) (err error)
- func UpdateRealm(properties RealmProperties) (err error)
- func UpdateService(realm, name string, payload io.Reader) (response []byte, err error)
- func ValidateSession(token string) (valid bool, err error)
- type IdAttributes
- type RealmProperties
Constants ¶
This section is empty.
Variables ¶
var AMURL = URL("am")
Base AM URL
var AdminPassword = "password"
AM admin's password
var DebugLogger = log.New(io.Discard, "", 0)
Functions ¶
func CreateAgent ¶
CreateAgent creates an agent (OAuth 2.0 Client, JWT Issuer etc) in the realm
func CreateRealm ¶
CreateRealm creates a realm with the given name Returns the realm Id that is required to modify/delete the realm
func CreateScript ¶
CreateScript creates the script in the realm
func CreateSecretMapping ¶
CreateSecretMapping creates or updates the secret mapping in the default keystore
func CreateService ¶
CreateService creates a service in the realm
func CreateTree ¶
CreateTree creates an auth tree in the realm
func CreateTreeNode ¶
CreateTreeNode creates an auth tree node in the realm
func DeleteAgent ¶
DeleteAgent deletes the agent from the realm
func DeleteRealm ¶
DeleteRealm deletes the realm with the given Id
func DeleteScript ¶
DeleteScript deletes the script from the realm
func DeleteService ¶
DeleteService deletes the service from the realm
func DeleteTree ¶
DeleteTree deletes the auth tree from the realm
func DeleteTreeNode ¶
DeleteTreeNode deletes the auth tree node from the realm
func GetIdentity ¶
GetIdentity gets the identity from AM
func GetService ¶
GetService returns the realm configuration of the given service
func LogoutSession ¶
LogoutSession represented by the given token
func OAuthBaseURL ¶ added in v7.2.0
OAuthBaseURL constructs the OAuth base URL that can be used as the audience for OAuth based requests
func RevokeAccessToken ¶ added in v7.1.0
RevokeAccessToken calls AM to revoke the access token
func SendUserConsent ¶ added in v7.1.0
func SendUserConsent(realm string, user IdAttributes, userCode thing.DeviceAuthorizationResponse, decision string) error
SendUserConsent will send the decision to allow or deny a device authorization grant request.
func UpdateAgent ¶
UpdateAgent updates an agent's (OAuth 2.0 Client, JWT Issuer etc) configuration in AM
func UpdateRealm ¶
func UpdateRealm(properties RealmProperties) (err error)
UpdateRealm updates the realm with the given properties
func UpdateService ¶
UpdateService updates the realm configuration of the given service
func ValidateSession ¶ added in v7.2.0
ValidateSession will validate the session represented by the given token
Types ¶
type IdAttributes ¶
type IdAttributes struct { Name string `json:"username"` ID string `json:"_id,omitempty"` Password string `json:"userPassword,omitempty"` ThingType callback.ThingType `json:"thingType,omitempty"` ThingKeys jose.JSONWebKeySet `json:"thingKeys,omitempty"` ThingOAuth2ClientName string `json:"thingOAuth2ClientName,omitempty"` ThingConfig string `json:"thingConfig,omitempty"` }
IdAttributes contains identity attributes
func CreateIdentity ¶
func CreateIdentity(realm string, attributes IdAttributes) (IdAttributes, error)
CreateIdentity creates an identity in the the given realm using the supplied attributes
func (IdAttributes) String ¶
func (id IdAttributes) String() string
type RealmProperties ¶
type RealmProperties struct { ID string `json:"_id,omitempty"` Name string `json:"name"` Active bool `json:"active"` ParentPath string `json:"parentPath"` Aliases []string `json:"aliases"` }
func GetRealm ¶
func GetRealm(fullName string) (properties RealmProperties, err error)
GetRealm searches for te realm with the given name