Documentation ¶
Overview ¶
Package authorization implements the IndyKite Authorization Service API Client.
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) IsAuthorized(ctx context.Context, digitalTwinID *authorizationpb.DigitalTwin, ...) (*authorizationpb.IsAuthorizedResponse, error)
- func (c *Client) IsAuthorizedByExternalID(ctx context.Context, externalID *authorizationpb.ExternalID, ...) (*authorizationpb.IsAuthorizedResponse, error)
- func (c *Client) IsAuthorizedByProperty(ctx context.Context, property *authorizationpb.Property, ...) (*authorizationpb.IsAuthorizedResponse, error)
- func (c *Client) IsAuthorizedByToken(ctx context.Context, token string, ...) (*authorizationpb.IsAuthorizedResponse, error)
- func (c *Client) IsAuthorizedWithRawRequest(ctx context.Context, req *authorizationpb.IsAuthorizedRequest, ...) (*authorizationpb.IsAuthorizedResponse, error)
- func (c *Client) WhatAuthorized(ctx context.Context, digitalTwinID *authorizationpb.DigitalTwin, ...) (*authorizationpb.WhatAuthorizedResponse, error)
- func (c *Client) WhatAuthorizedByExternalID(ctx context.Context, externalID *authorizationpb.ExternalID, ...) (*authorizationpb.WhatAuthorizedResponse, error)
- func (c *Client) WhatAuthorizedByProperty(ctx context.Context, property *authorizationpb.Property, ...) (*authorizationpb.WhatAuthorizedResponse, error)
- func (c *Client) WhatAuthorizedByToken(ctx context.Context, token string, ...) (*authorizationpb.WhatAuthorizedResponse, error)
- func (c *Client) WhatAuthorizedWithRawRequest(ctx context.Context, req *authorizationpb.WhatAuthorizedRequest, ...) (*authorizationpb.WhatAuthorizedResponse, error)
- func (c *Client) WhoAuthorized(ctx context.Context, req *authorizationpb.WhoAuthorizedRequest, ...) (*authorizationpb.WhoAuthorizedResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientFromGRPCClient ¶
func NewClientFromGRPCClient(client authorizationpb.AuthorizationAPIClient) (*Client, error)
NewClientFromGRPCClient creates a new Authorization API gRPC client from an existing gRPC client.
func NewTestClient ¶ added in v0.17.0
func NewTestClient(_ context.Context, client authorizationpb.AuthorizationAPIClient) (*Client, error)
NewTestClient creates a new Authorization gRPC Client.
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) IsAuthorized ¶
func (c *Client) IsAuthorized( ctx context.Context, digitalTwinID *authorizationpb.DigitalTwin, resources []*authorizationpb.IsAuthorizedRequest_Resource, inputParams map[string]*authorizationpb.InputParam, policyTags []string, opts ...grpc.CallOption, ) (*authorizationpb.IsAuthorizedResponse, error)
IsAuthorized checks if DigitalTwin can perform actions on resources.
func (*Client) IsAuthorizedByExternalID ¶ added in v0.20.0
func (c *Client) IsAuthorizedByExternalID( ctx context.Context, externalID *authorizationpb.ExternalID, resources []*authorizationpb.IsAuthorizedRequest_Resource, inputParams map[string]*authorizationpb.InputParam, policyTags []string, opts ...grpc.CallOption, ) (*authorizationpb.IsAuthorizedResponse, error)
IsAuthorizedByExternalID checks if DigitalTwin, identified by external_id, can perform actions on resources.
func (*Client) IsAuthorizedByProperty ¶
func (c *Client) IsAuthorizedByProperty( ctx context.Context, property *authorizationpb.Property, resources []*authorizationpb.IsAuthorizedRequest_Resource, inputParams map[string]*authorizationpb.InputParam, policyTags []string, opts ...grpc.CallOption, ) (*authorizationpb.IsAuthorizedResponse, error)
IsAuthorizedByProperty checks if DigitalTwin, identified by property filter, can perform actions on resources.
func (*Client) IsAuthorizedByToken ¶
func (c *Client) IsAuthorizedByToken( ctx context.Context, token string, resources []*authorizationpb.IsAuthorizedRequest_Resource, inputParams map[string]*authorizationpb.InputParam, policyTags []string, opts ...grpc.CallOption, ) (*authorizationpb.IsAuthorizedResponse, error)
IsAuthorizedByToken checks if DigitalTwin, identified by access token, can perform actions on resources.
func (*Client) IsAuthorizedWithRawRequest ¶
func (c *Client) IsAuthorizedWithRawRequest( ctx context.Context, req *authorizationpb.IsAuthorizedRequest, opts ...grpc.CallOption, ) (*authorizationpb.IsAuthorizedResponse, error)
func (*Client) WhatAuthorized ¶
func (c *Client) WhatAuthorized( ctx context.Context, digitalTwinID *authorizationpb.DigitalTwin, resourceTypes []*authorizationpb.WhatAuthorizedRequest_ResourceType, inputParams map[string]*authorizationpb.InputParam, policyTags []string, opts ...grpc.CallOption, ) (*authorizationpb.WhatAuthorizedResponse, error)
WhatAuthorized returns a list of resources and allowed actions for provided resource types for subject, identified by DigitalTwinIdentifier, can access.
func (*Client) WhatAuthorizedByExternalID ¶ added in v0.20.0
func (c *Client) WhatAuthorizedByExternalID( ctx context.Context, externalID *authorizationpb.ExternalID, resourceTypes []*authorizationpb.WhatAuthorizedRequest_ResourceType, inputParams map[string]*authorizationpb.InputParam, policyTags []string, opts ...grpc.CallOption, ) (*authorizationpb.WhatAuthorizedResponse, error)
WhatAuthorizedByExternalID returns a list of resources and allowed actions for provided resource types for subject, identified by external_id, can access.
func (*Client) WhatAuthorizedByProperty ¶
func (c *Client) WhatAuthorizedByProperty( ctx context.Context, property *authorizationpb.Property, resourceTypes []*authorizationpb.WhatAuthorizedRequest_ResourceType, inputParams map[string]*authorizationpb.InputParam, policyTags []string, opts ...grpc.CallOption, ) (*authorizationpb.WhatAuthorizedResponse, error)
WhatAuthorizedByProperty returns a list of resources and allowed actions for provided resource types for subject, identified by property filter, can access.
func (*Client) WhatAuthorizedByToken ¶
func (c *Client) WhatAuthorizedByToken( ctx context.Context, token string, resourceTypes []*authorizationpb.WhatAuthorizedRequest_ResourceType, inputParams map[string]*authorizationpb.InputParam, policyTags []string, opts ...grpc.CallOption, ) (*authorizationpb.WhatAuthorizedResponse, error)
WhatAuthorizedByToken returns a list of resources and allowed actions for provided resource types for subject, identified by access token, can access.
func (*Client) WhatAuthorizedWithRawRequest ¶
func (c *Client) WhatAuthorizedWithRawRequest( ctx context.Context, req *authorizationpb.WhatAuthorizedRequest, opts ...grpc.CallOption, ) (*authorizationpb.WhatAuthorizedResponse, error)
WhatAuthorizedWithRawRequest returns a list of resources and allowed actions for provided resource types for subject can access.
func (*Client) WhoAuthorized ¶
func (c *Client) WhoAuthorized( ctx context.Context, req *authorizationpb.WhoAuthorizedRequest, opts ...grpc.CallOption, ) (*authorizationpb.WhoAuthorizedResponse, error)
WhoAuthorized returns a list of subjects and allowed actions for provided resources.