MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / requireCurrentOrg

Function requireCurrentOrg

app/controlplane/internal/service/service.go:104–111  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

102}
103
104func requireCurrentOrg(ctx context.Context) (*entities.Org, error) {
105 currentOrg := entities.CurrentOrg(ctx)
106 if currentOrg == nil {
107 return nil, errors.NotFound("not found", "current organization not set")
108 }
109
110 return currentOrg, nil
111}
112
113func requireCurrentAuthzSubject(ctx context.Context) (string, error) {
114 sub := usercontext.CurrentAuthzSubject(ctx)

Callers 15

TestRequireCurrentOrgFunction · 0.85
CreateMethod · 0.85
UpdateMethod · 0.85
ListMethod · 0.85
DeleteMethod · 0.85
ViewMethod · 0.85
CreateMethod · 0.85
ListMethod · 0.85
RevokeMethod · 0.85
CreateMethod · 0.85
RevokeMethod · 0.85
ListSentMethod · 0.85

Calls 1

CurrentOrgFunction · 0.92

Tested by 1

TestRequireCurrentOrgFunction · 0.68