Documentation ¶
Overview ¶
Package api implements the sentry backend API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterService ¶
RegisterService registers a new sentry service with the given gRPC server.
Types ¶
type Backend ¶
type Backend interface { // Get addresses returns the list of consensus and TLS addresses of the sentry node. GetAddresses(context.Context) (*SentryAddresses, error) // SetUpstreamTLSPubKeys notifies the sentry node of the new TLS public keys used by its // upstream node. SetUpstreamTLSPubKeys(context.Context, []signature.PublicKey) error // GetUpstreamTLSPubKeys returns the TLS public keys of the sentry node's upstream node. GetUpstreamTLSPubKeys(context.Context) ([]signature.PublicKey, error) // UpdatePolicies notifies the sentry node of policy changes. UpdatePolicies(context.Context, ServicePolicies) error }
Backend is a sentry backend implementation.
func NewSentryClient ¶
func NewSentryClient(c *grpc.ClientConn) Backend
NewSentryClient creates a new gRPC sentry client service.
type LocalBackend ¶
type LocalBackend interface { Backend // GetPolicyChecker returns the current access policy checker for the given service. GetPolicyChecker(context.Context, grpc.ServiceName) (*policy.DynamicRuntimePolicyChecker, error) }
LocalBackend is a local sentry backend implementation.
type SentryAddresses ¶
type SentryAddresses struct { Consensus []node.ConsensusAddress `json:"consensus"` TLS []node.TLSAddress `json:"tls"` }
SentryAddresses contains sentry node consensus and TLS addresses.
type ServicePolicies ¶
type ServicePolicies struct { Service grpc.ServiceName `json:"service"` AccessPolicies map[common.Namespace]accessctl.Policy `json:"access_policies"` }
ServicePolicies contains policies for a GRPC service.
Click to show internal directories.
Click to hide internal directories.