Documentation ¶
Index ¶
- type Service
- func (s *Service) Authorize(ctx context.Context, in *pb.AuthorizeRequest) (*pb.AuthorizeResponse, error)
- func (s *Service) CreatePolicy(ctx context.Context, in *pb.CreatePolicyRequest) (*pb.Policy, error)
- func (s *Service) DeletePolicy(ctx context.Context, in *pb.DeletePolicyRequest) (*empty.Empty, error)
- func (s *Service) GetPolicy(ctx context.Context, in *pb.GetPolicyRequest) (*pb.Policy, error)
- func (s *Service) ListPolicies(ctx context.Context, in *pb.ListPoliciesRequest) (*pb.ListPoliciesResponse, error)
- func (s *Service) Register(server *grpc.Server)
- func (s *Service) UpdatePolicy(ctx context.Context, in *pb.UpdatePolicyRequest) (*pb.Policy, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service contains dependencies used by the service and the service implementation.
func NewService ¶
NewService create a new service with a default configuration.
func (*Service) Authorize ¶
func (s *Service) Authorize(ctx context.Context, in *pb.AuthorizeRequest) (*pb.AuthorizeResponse, error)
Authorize decides whether a given authorization request should be allowed or denied.
func (*Service) CreatePolicy ¶
CreatePolicy create a policy. This function should not allow upsert and returns error when the policy already exist. This function allow End-User to override the default auto generate policy ID.
func (*Service) DeletePolicy ¶
func (s *Service) DeletePolicy(ctx context.Context, in *pb.DeletePolicyRequest) (*empty.Empty, error)
DeletePolicy delete the policy with the given policy ID from the state. This function can or not can returns error when the given policy ID does not exist it's depend of the storage implementation.
func (*Service) GetPolicy ¶
GetPolicy returns the policy stored in the state. This function returns an error when the policy does not exist.
func (*Service) ListPolicies ¶
func (s *Service) ListPolicies(ctx context.Context, in *pb.ListPoliciesRequest) (*pb.ListPoliciesResponse, error)
func (*Service) UpdatePolicy ¶
UpdatePolicy upsert a policy. This function create the policy when the ID does not exist or update the policy with the same ID. If you need creation only use the CreatePolicy function. This function allow End-User to override the default auto generate policy ID.