iamexample

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package iamexample provides a reference implementation of a gRPC service that uses IAM for access management.

Index

Constants

View Source
const MemberHeader = "x-iam-example-members"

MemberHeader is the gRPC header used by the example server to determine IAM members of the caller.

Variables

This section is empty.

Functions

func NewMemberHeaderResolver added in v0.2.0

func NewMemberHeaderResolver() iamcaller.Resolver

NewMemberHeaderResolver returns an iammember.Resolver that resolves members from MemberHeader.

func SQLSchema added in v0.4.0

func SQLSchema() string

SQLSchema returns the example Spanner SQL schema.

func WithOutgoingMembers added in v0.2.0

func WithOutgoingMembers(ctx context.Context, members ...string) context.Context

WithOutgoingMembers appends the provided members to the outgoing gRPC context.

Types

type Config

type Config struct {
	ErrorHook func(context.Context, error)
}

Config for a Server.

type Server

type Server struct {
	IAM     *iamspanner.IAMServer
	Spanner *spanner.Client
	Config  Config
}

Server implements iamexamplev1.FreightServiceServer.

func (*Server) BatchGetShipments

BatchGetShipments implements iamexamplev1.FreightServiceServer.

func (*Server) BatchGetSites

BatchGetSites implements iamexamplev1.FreightServiceServer.

func (*Server) CancelOperation added in v0.18.0

CancelOperation implements longrunningpb.OperationsServer.

func (*Server) CreateShipment

func (s *Server) CreateShipment(
	ctx context.Context,
	request *iamexamplev1.CreateShipmentRequest,
) (*iamexamplev1.Shipment, error)

func (*Server) CreateShipper

func (s *Server) CreateShipper(
	ctx context.Context,
	request *iamexamplev1.CreateShipperRequest,
) (*iamexamplev1.Shipper, error)

CreateShipper implements iamexamplev1.FreightServiceServer.

func (*Server) CreateSite

func (s *Server) CreateSite(
	ctx context.Context,
	request *iamexamplev1.CreateSiteRequest,
) (*iamexamplev1.Site, error)

CreateSite implements iamexamplev1.FreightServiceServer.

func (*Server) DeleteOperation added in v0.18.0

DeleteOperation implements longrunningpb.OperationsServer.

func (*Server) DeleteShipment

func (s *Server) DeleteShipment(
	ctx context.Context,
	request *iamexamplev1.DeleteShipmentRequest,
) (*iamexamplev1.Shipment, error)

DeleteShipment implements iamexamplev1.FreightServiceServer.

func (*Server) DeleteShipper

func (s *Server) DeleteShipper(
	ctx context.Context,
	request *iamexamplev1.DeleteShipperRequest,
) (*longrunningpb.Operation, error)

DeleteShipper implements iamexamplev1.FreightServiceServer.

func (*Server) DeleteSite

func (s *Server) DeleteSite(
	ctx context.Context,
	request *iamexamplev1.DeleteSiteRequest,
) (*iamexamplev1.Site, error)

DeleteSite implements iamexamplev1.FreightServiceServer.

func (*Server) GetIamPolicy

func (s *Server) GetIamPolicy(
	ctx context.Context,
	request *iampb.GetIamPolicyRequest,
) (*iampb.Policy, error)

GetIamPolicy implements iampb.IAMPolicyServer.

func (*Server) GetOperation added in v0.18.0

GetOperation implements longrunningpb.OperationsServer.

func (*Server) GetRole added in v0.21.0

func (s *Server) GetRole(
	ctx context.Context,
	request *adminpb.GetRoleRequest,
) (*adminpb.Role, error)

GetRole implements adminpb.IAMServer.

func (*Server) GetShipment

func (s *Server) GetShipment(
	ctx context.Context,
	request *iamexamplev1.GetShipmentRequest,
) (*iamexamplev1.Shipment, error)

GetShipment implements iamexamplev1.FreightServiceServer.

func (*Server) GetShipper

func (s *Server) GetShipper(
	ctx context.Context,
	request *iamexamplev1.GetShipperRequest,
) (*iamexamplev1.Shipper, error)

GetShipper implements iamexamplev1.FreightServiceServer.

func (*Server) GetSite

func (s *Server) GetSite(
	ctx context.Context,
	request *iamexamplev1.GetSiteRequest,
) (*iamexamplev1.Site, error)

GetSite implements iamexamplev1.FreightServiceServer.

func (*Server) ListOperations added in v0.18.0

ListOperations implements longrunningpb.OperationsServer.

func (*Server) ListRoles added in v0.16.0

func (s *Server) ListRoles(
	ctx context.Context,
	request *adminpb.ListRolesRequest,
) (*adminpb.ListRolesResponse, error)

ListRoles implements adminpb.IAMServer.

func (*Server) ListShipments

ListShipments implements iamexamplev1.FreightServiceServer.

func (*Server) ListShippers

ListShippers implements iamexamplev1.FreightServiceServer.

func (*Server) ListSites

ListSites implements iamexamplev1.FreightServiceServer.

func (*Server) SetIamPolicy

func (s *Server) SetIamPolicy(
	ctx context.Context,
	request *iampb.SetIamPolicyRequest,
) (*iampb.Policy, error)

SetIamPolicy implements iampb.IAMPolicyServer.

func (*Server) TestIamPermissions

func (s *Server) TestIamPermissions(
	ctx context.Context,
	request *iampb.TestIamPermissionsRequest,
) (*iampb.TestIamPermissionsResponse, error)

TestIamPermissions implements iampb.IAMPolicyServer.

func (*Server) UpdateShipment

func (s *Server) UpdateShipment(
	ctx context.Context,
	request *iamexamplev1.UpdateShipmentRequest,
) (*iamexamplev1.Shipment, error)

UpdateShipment implements iamexamplev1.FreightServiceServer.

func (*Server) UpdateShipper

func (s *Server) UpdateShipper(
	ctx context.Context,
	request *iamexamplev1.UpdateShipperRequest,
) (*iamexamplev1.Shipper, error)

UpdateShipper implements iamexamplev1.FreightServiceServer.

func (*Server) UpdateSite

func (s *Server) UpdateSite(
	ctx context.Context,
	request *iamexamplev1.UpdateSiteRequest,
) (*iamexamplev1.Site, error)

UpdateSite implements iamexamplev1.FreightServiceServer.

func (*Server) WaitOperation added in v0.18.0

WaitOperation implements longrunningpb.OperationsServer.

Directories

Path Synopsis
Package iamexampledata provides predefined example data for the IAM example service.
Package iamexampledata provides predefined example data for the IAM example service.

Jump to

Keyboard shortcuts

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