client

package
v0.0.0-...-2b423b8 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConsents

func CreateConsents(client *AapClient, url string, requests []CreateConsentsRequest) (status int, responses bulky.Responses, err error)

func CreateConsentsAuthorize

func CreateConsentsAuthorize(client *AapClient, url string, requests []CreateConsentsAuthorizeRequest) (status int, responses bulky.Responses, err error)

func CreateConsentsReject

func CreateConsentsReject(client *AapClient, url string, requests []CreateConsentsRejectRequest) (status int, responses bulky.Responses, err error)

func CreateEntities

func CreateEntities(client *AapClient, url string, requests []CreateEntitiesRequest) (status int, responses bulky.Responses, err error)

func CreateGrants

func CreateGrants(client *AapClient, url string, requests []CreateGrantsRequest) (status int, responses bulky.Responses, err error)

func CreatePublishes

func CreatePublishes(client *AapClient, url string, requests []CreatePublishesRequest) (status int, responses bulky.Responses, err error)

func CreateScopes

func CreateScopes(client *AapClient, url string, requests []CreateScopesRequest) (status int, responses bulky.Responses, err error)

func CreateShadows

func CreateShadows(client *AapClient, url string, requests []CreateShadowsRequest) (status int, responses bulky.Responses, err error)

func CreateSubscriptions

func CreateSubscriptions(client *AapClient, url string, requests []CreateSubscriptionsRequest) (status int, responses bulky.Responses, err error)

func DeleteConsents

func DeleteConsents(client *AapClient, url string, requests []DeleteConsentsRequest) (status int, responses bulky.Responses, err error)

func DeleteGrants

func DeleteGrants(client *AapClient, url string, requests []DeleteGrantsRequest) (status int, responses bulky.Responses, err error)

func DeleteShadows

func DeleteShadows(client *AapClient, url string, requests []DeleteShadowsRequest) (status int, responses bulky.Responses, err error)

func DeleteSubscriptions

func DeleteSubscriptions(client *AapClient, url string, requests []DeleteSubscriptionsRequest) (status int, responses bulky.Responses, err error)

func ReadConsents

func ReadConsents(client *AapClient, url string, requests []ReadConsentsRequest) (status int, responses bulky.Responses, err error)

func ReadConsentsAuthorize

func ReadConsentsAuthorize(client *AapClient, url string, requests []ReadConsentsAuthorizeRequest) (status int, responses bulky.Responses, err error)

func ReadEntitiesJudge

func ReadEntitiesJudge(client *AapClient, url string, requests []ReadEntitiesJudgeRequest) (status int, responses bulky.Responses, err error)

func ReadGrants

func ReadGrants(client *AapClient, url string, requests []ReadGrantsRequest) (status int, responses bulky.Responses, err error)

func ReadPublishes

func ReadPublishes(client *AapClient, url string, requests []ReadPublishesRequest) (status int, responses bulky.Responses, err error)

func ReadScopes

func ReadScopes(client *AapClient, url string, requests []ReadScopesRequest) (status int, responses bulky.Responses, err error)

func ReadShadows

func ReadShadows(client *AapClient, url string, requests []ReadShadowsRequest) (status int, responses bulky.Responses, err error)

func ReadSubscriptions

func ReadSubscriptions(client *AapClient, url string, requests []ReadSubscriptionsRequest) (status int, responses bulky.Responses, err error)

func UpdatePublishes

func UpdatePublishes(client *AapClient, url string, requests []UpdatePublishesRequest) (status int, responses bulky.Responses, err error)

func UpdateScopes

func UpdateScopes(client *AapClient, url string, requests []UpdateScopesRequest) (status int, responses bulky.Responses, err error)

Types

type AapClient

type AapClient struct {
	*http.Client
}

func NewAapClient

func NewAapClient(config *clientcredentials.Config) *AapClient

func NewAapClientWithUserAccessToken

func NewAapClientWithUserAccessToken(config *oauth2.Config, token *oauth2.Token) *AapClient

type Authorization

type Authorization struct {
	Challenge  string `json:"challenge" validate:"required"`
	Authorized bool   `json:"authorized"`
	RedirectTo string `json:"redirect_to" validate:"omitempty,uri"`

	ClientId   string `json:"client_id" validate:"required,uuid"`
	ClientName string `json:"client_name,omitempty"`

	Subject      string `json:"subject" validate:"required,uuid"`
	SubjectName  string `json:"subject_name,omitempty"`
	SubjectEmail string `json:"subject_email,omitempty" validate:"omitempty,email"`

	ConsentRequests []ConsentRequest
}
type Consent struct {
	Reference  string `json:"reference_id"  validate:"required,uuid"` // OAuth2:Subject
	Subscriber string `json:"subscriber_id" validate:"required,uuid"` // OAuth2:Client
	Publisher  string `json:"publisher_id"  validate:"required,uuid"` // OAuth2:Resource Server
	Scope      string `json:"scope"         validate:"required"`      // OAuth2:Scope, published by the resource server
}

type ConsentRequest

type ConsentRequest struct {
	Scope       string
	Audience    string
	Title       string
	Description string
	Consented   bool
}

type CreateConsentsAuthorizeRequest

type CreateConsentsAuthorizeRequest struct {
	Challenge string `json:"challenge" validate:"required"`
}

type CreateConsentsAuthorizeResponse

type CreateConsentsAuthorizeResponse Authorization

type CreateConsentsRejectRequest

type CreateConsentsRejectRequest struct {
	Challenge string `json:"challenge" validate:"required"`
}

type CreateConsentsRejectResponse

type CreateConsentsRejectResponse Authorization

type CreateConsentsRequest

type CreateConsentsRequest struct {
	Reference  string `json:"reference_id"  validate:"required,uuid"` // OAuth2:Subject
	Subscriber string `json:"subscriber_id" validate:"required,uuid"` // OAuth2:Client
	Publisher  string `json:"publisher_id"  validate:"required,uuid"` // OAuth2:Resource Server
	Scope      string `json:"scope"         validate:"required"`      // OAuth2:Scope, published by the resource server
}

type CreateConsentsResponse

type CreateConsentsResponse Consent

type CreateEntitiesRequest

type CreateEntitiesRequest struct {
	Reference string   `json:"reference_id" validate:"required,uuid"`
	Creator   string   `json:"creator_id" validate:"required,uuid"`
	Scopes    []string `json:"scopes" validate:"required"`
}

type CreateEntitiesResponse

type CreateEntitiesResponse Entity

type CreateGrantsRequest

type CreateGrantsRequest struct {
	Identity   string `json:"identity_id" validate:"required,uuid"`
	Scope      string `json:"scope" validate:"required"`
	Publisher  string `json:"publisher_id" validate:"required,uuid"`
	OnBehalfOf string `json:"on_behalf_of_id" validate:"required,uuid"`
	NotBefore  int64  `json:"nbf" validate:"gte=0"`
	Expire     int64  `json:"exp" validate:"eq=0|gtefield=NotBefore"`
}

type CreateGrantsResponse

type CreateGrantsResponse Grant

type CreatePublishesRequest

type CreatePublishesRequest struct {
	Publisher   string `json:"publisher_id" validate:"required,uuid"`
	Scope       string `json:"scope" validate:"required,excludes= "`
	Title       string `json:"title" validate:"required"`
	Description string `json:"description" validate:"required"`
}

type CreatePublishesResponse

type CreatePublishesResponse Publish

type CreateScopesRequest

type CreateScopesRequest struct {
	Scope string `json:"scope" validate:"required"`
}

type CreateScopesResponse

type CreateScopesResponse Scope

type CreateShadowsRequest

type CreateShadowsRequest struct {
	Identity  string `json:"identity_id" validate:"required,uuid"`
	Shadow    string `json:"shadow_id" validate:"required,uuid"`
	NotBefore int64  `json:"nbf" validate:"gte=0"`
	Expire    int64  `json:"exp" validate:"eq=0|gtefield=NotBefore"`
}

type CreateShadowsResponse

type CreateShadowsResponse Shadow

type CreateSubscriptionsRequest

type CreateSubscriptionsRequest struct {
	Subscriber string `json:"subscriber_id" validate:"required,uuid"`
	Publisher  string `json:"publisher_id" validate:"required,uuid"`
	Scope      string `json:"scope" validate:"required"`
}

type CreateSubscriptionsResponse

type CreateSubscriptionsResponse Subscription

type DeleteConsentsRequest

type DeleteConsentsRequest struct {
	Reference  string `json:"reference_id"  validate:"required,uuid"` // OAuth2:Subject
	Subscriber string `json:"subscriber_id" validate:"required,uuid"` // OAuth2:Client
	Publisher  string `json:"publisher_id"  validate:"required,uuid"` // OAuth2:Resource Server
	Scope      string `json:"scope"         validate:"required"`      // OAuth2:Scope, published by the resource server
}

type DeleteConsentsResponse

type DeleteConsentsResponse Consent

type DeleteGrantsRequest

type DeleteGrantsRequest struct {
	Identity   string `json:"identity_id" validate:"required,uuid"`
	Scope      string `json:"scope" validate:"required"`
	Publisher  string `json:"publisher_id" validate:"required,uuid"`
	OnBehalfOf string `json:"on_behalf_of_id" validate:"required,uuid"`
}

type DeleteGrantsResponse

type DeleteGrantsResponse struct{}

type DeleteShadowsRequest

type DeleteShadowsRequest struct {
	Identity string `json:"identity_id" validate:"required,uuid"`
	Shadow   string `json:"shadow_id" validate:"required,uuid"`
}

type DeleteShadowsResponse

type DeleteShadowsResponse Shadow

type DeleteSubscriptionsRequest

type DeleteSubscriptionsRequest struct {
	Subscriber string `json:"subscriber_id" validate:"required,uuid"`
	Publisher  string `json:"publisher_id" validate:"required,uuid"`
	Scope      string `json:"scope" validate:"required"`
}

type DeleteSubscriptionsResponse

type DeleteSubscriptionsResponse struct{}

type Entity

type Entity struct {
	Reference string   `json:"reference_id" validate:"required,uuid"`
	Creator   string   `json:"creator_id" validate:"required,uuid"`
	Scopes    []string `json:"scopes" validate:"required"`
}

type Grant

type Grant struct {
	Identity       string   `json:"identity_id" validate:"required,uuid"`
	Scope          string   `json:"scope" validate:"required"`
	Publisher      string   `json:"publisher_id" validate:"required,uuid"`
	OnBehalfOf     string   `json:"on_behalf_of_id" validate:"required,uuid"`
	MayGrantScopes []string `json:"may_grant_scopes" validate:"omitempty"`
	NotBefore      int64    `json:"nbf" validate:"gte=0"`
	Expire         int64    `json:"exp" validate:"eq=0|gtefield=NotBefore"`
}

type Publish

type Publish struct {
	Publisher      string   `json:"publisher_id" validate:"required,uuid"`
	Scope          string   `json:"scope" validate:"required"`
	MayGrantScopes []string `json:"may_grant_scopes" validate:"omitempty"`
	Title          string   `json:"title"`
	Description    string   `json:"description"`
}

type ReadConsentsAuthorizeRequest

type ReadConsentsAuthorizeRequest struct {
	Challenge string `json:"challenge" validate:"required"`
}

type ReadConsentsAuthorizeResponse

type ReadConsentsAuthorizeResponse Authorization

type ReadConsentsRequest

type ReadConsentsRequest struct {
	Reference  string   `json:"reference_id"            validate:"required,uuid"`
	Subscriber string   `json:"subscriber_id,omitempty" validate:"omitempty,uuid"` // OAuth2:Client
	Publisher  string   `json:"publisher_id,omitempty"  validate:"omitempty,uuid"` // OAuth2:Resource Server
	Scopes     []string `json:"scopes,omitempty"        validate:"omitempty"`      // OAuth2:Scope, published by the resource server
}

type ReadConsentsResponse

type ReadConsentsResponse []Consent

type ReadEntitiesJudgeRequest

type ReadEntitiesJudgeRequest struct {
	AccessToken string   `json:"access_token"     validate:"required"`
	Publisher   string   `json:"publisher_id"     validate:"required,uuid"` // Resource Server Audience
	Scope       string   `json:"scope"            validate:"required"`
	Owners      []string `json:"owners,omitempty" validate:"omitempty,dive,uuid"` // Resource Owners (often publisher or Subject)
}

type ReadEntitiesJudgeResponse

type ReadEntitiesJudgeResponse Verdict

AAP requires all calls to be HTTP override post. This prevenst leaking of access token into by accident into access log like with normal GET requests.

type ReadGrantsRequest

type ReadGrantsRequest struct {
	Identity   string `json:"identity_id,omitempty" validate:"omitempty,uuid"`
	Scope      string `json:"scope,omitempty" validate:"omitempty"`
	Publisher  string `json:"publisher_id,omitempty" validate:"omitempty,uuid"`
	OnBehalfOf string `json:"on_behalf_of_id,omitempty" validate:"omitempty,uuid"`
}

type ReadGrantsResponse

type ReadGrantsResponse []Grant

type ReadPublishesRequest

type ReadPublishesRequest struct {
	Publisher string   `json:"publisher_id,omitempty" validate:"omitempty,uuid"`
	Scopes    []string `json:"scopes,omitempty" validate:"omitempty"`
}

type ReadPublishesResponse

type ReadPublishesResponse []Publish

type ReadScopesRequest

type ReadScopesRequest struct {
	Scope string `json:"scope" validate:"required"`
}

type ReadScopesResponse

type ReadScopesResponse []Scope

type ReadShadowsRequest

type ReadShadowsRequest struct {
	Identity string `json:"identity_id" validate:"omitempty,uuid"`
	Shadow   string `json:"shadow_id" validate:"omitempty,uuid"`
}

type ReadShadowsResponse

type ReadShadowsResponse []Shadow

type ReadSubscriptionsRequest

type ReadSubscriptionsRequest struct {
	Subscriber string   `json:"subscriber_id" validate:"required,uuid"`
	Publisher  string   `json:"publisher_id,omitempty" validate:"omitempty,uuid"`
	Scopes     []string `json:"scopes" validate:"omitempty"`
}

type ReadSubscriptionsResponse

type ReadSubscriptionsResponse []Subscription

type Scope

type Scope struct {
	Scope string `json:"scope" validate:"required"`
}

type Shadow

type Shadow struct {
	Identity  string `json:"identity_id" validate:"required,uuid"`
	Shadow    string `json:"shadow_id" validate:"required,uuid"`
	NotBefore int64  `json:"nbf" validate:"gte=0"`
	Expire    int64  `json:"exp" validate:"eq=0|gtefield=NotBefore"`
}

type Subscription

type Subscription struct {
	Subscriber string `json:"subscriber_id" validate:"required,uuid"`
	Publisher  string `json:"publisher_id" validate:"required,uuid"`
	Scope      string `json:"scope" validate:"required"`
}

type UpdatePublishesRequest

type UpdatePublishesRequest struct {
	Publisher string `json:"publisher_id,omitempty" validate:"omitempty,uuid"`
}

type UpdatePublishesResponse

type UpdatePublishesResponse Publish

type UpdateScopesRequest

type UpdateScopesRequest struct {
	Scope string `json:"scope" validate:"required"`
}

type UpdateScopesResponse

type UpdateScopesResponse Scope

type Verdict

type Verdict struct {
	Granted bool `json:"is_granted"`

	// Echo
	Publisher string   `json:"publisher_id" validate:"omitempty,uuid"` // Resource Server Audience
	Scope     string   `json:"scope"        validate:"omitempty"`
	Owners    []string `json:"owners"       validate:"omitempty,dive,uuid"` // Resource Owners (often publisher or Subject)

	// Introspected
	Identity string `json:"identity_id"  validate:"omitempty,uuid"` // Subject access_token.sub
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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