diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-02 16:05:53 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-02 16:05:53 -0600 |
| commit | a3d5ee1225e2ce0b6cf3b90525a6876ca8f5ef8c (patch) | |
| tree | 429faf79855a2614b4c18bb286f94f474caf7e5c /pkg/rpc/ability_service.go | |
| parent | 649b71d7fd2d6768460a37ed0d9e6ce7a1202a4f (diff) | |
refactor: connect logging to http requests
Diffstat (limited to 'pkg/rpc/ability_service.go')
| -rw-r--r-- | pkg/rpc/ability_service.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/pkg/rpc/ability_service.go b/pkg/rpc/ability_service.go deleted file mode 100644 index db2e8fab..00000000 --- a/pkg/rpc/ability_service.go +++ /dev/null @@ -1,26 +0,0 @@ -package rpc - -import ( - context "context" - - "github.com/cedar-policy/cedar-go" - "gitlab.com/gitlab-org/software-supply-chain-security/authorization/authz.d/pkg/gid" - "gitlab.com/gitlab-org/software-supply-chain-security/authorization/authz.d/pkg/policies" -) - -type AbilityService struct { -} - -func NewAbilityService() *AbilityService { - return &AbilityService{} -} - -func (h *AbilityService) Allowed(ctx context.Context, req *AllowRequest) (*AllowReply, error) { - ok := policies.Allowed(cedar.Request{ - Principal: gid.NewEntityUID(req.Subject), - Action: cedar.NewEntityUID("Permission", cedar.String(req.Permission)), - Resource: gid.NewEntityUID(req.Resource), - Context: cedar.NewRecord(cedar.RecordMap{}), - }) - return &AllowReply{Result: ok}, nil -} |
