authorization

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package authorization implements the IndyKite Authorization Service API Client.

Index

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 NewClient

func NewClient(ctx context.Context, opts ...api.ClientOption) (*Client, error)

NewClient creates a new Authorization API gRPC client.

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

NewTestClient creates a new Authorization gRPC Client.

func (*Client) Close

func (c *Client) Close() error

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

WhoAuthorized returns a list of subjects and allowed actions for provided resources.

Jump to

Keyboard shortcuts

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