check

package
v0.1.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGrpcService

func NewGrpcService(service Service, logger *zap.Logger) proto.CheckServer

func RegisterHandlers

func RegisterHandlers(r *echo.Group, service Service)

Types

type CheckDetails

type CheckDetails struct {
	Roles          []primitive.ObjectID
	Polcies        []primitive.ObjectID
	UserProperties map[string]interface{}
}

type CheckRequest

type CheckRequest struct {
	Identifier string `json:"identifier"`
	Action     string `json:"action"`
	Resource   string `json:"resource"`
}

type Repository

type Repository interface {
	ValidateAPIKey(ctx context.Context, org_identifier string, apiKey string) (bool, error)
	GetRolePermissions(ctx context.Context, org_identifier string, role_ids []primitive.ObjectID) (*[]mongo_entity.Permission, error)
	GetCheckDetails(ctx context.Context, org_identifier string, identifier string) (CheckDetails, error)
	GetActivePolicyVersionContents(ctx context.Context, org_identifier string, policy_ids []primitive.ObjectID) (map[string]string, error)
}

func NewRepository

func NewRepository(mongodb *db.MongoDB) Repository

type Service

type Service interface {
	Check(ctx context.Context, org_identifier string, req CheckRequest, apiKey string, skipValidation bool) (bool, error)
}

func NewService

func NewService(repo Repository, logger *zap.Logger) Service

Jump to

Keyboard shortcuts

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