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

Function pbOrgItemToAction

app/cli/pkg/action/membership_list.go:137–161  ·  view source on GitHub ↗
(in *pb.OrgItem)

Source from the content-addressed store, hash-verified

135}
136
137func pbOrgItemToAction(in *pb.OrgItem) *OrgItem {
138 i := &OrgItem{
139 ID: in.Id,
140 Name: in.Name,
141 CreatedAt: toTimePtr(in.CreatedAt.AsTime()),
142 PolicyAllowedHostnames: in.PolicyAllowedHostnames,
143 PreventImplicitWorkflowCreation: in.PreventImplicitWorkflowCreation,
144 EnableAIAgentCollector: in.EnableAiAgentCollector,
145 BlockAttestationsOnReleasedVersions: in.BlockAttestationsOnReleasedVersions,
146 SkipRunnerEnvVars: in.SkipRunnerEnvVars,
147 }
148
149 if in.DefaultPolicyViolationStrategy == pb.OrgItem_POLICY_VIOLATION_BLOCKING_STRATEGY_BLOCK {
150 i.PolicyViolationBlockingStrategy = PolicyViolationBlockingStrategyEnforced
151 } else {
152 i.PolicyViolationBlockingStrategy = PolicyViolationBlockingStrategyAdvisory
153 }
154
155 if in.ApiTokenMaxDaysInactive != nil {
156 s := fmt.Sprintf("%d", in.GetApiTokenMaxDaysInactive())
157 i.APITokenMaxDaysInactive = &s
158 }
159
160 return i
161}
162
163func pbMembershipItemToAction(in *pb.OrgMembershipItem) *MembershipItem {
164 if in == nil {

Callers 4

pbMembershipItemToActionFunction · 0.85
RunMethod · 0.85
RunMethod · 0.85

Calls 2

toTimePtrFunction · 0.70

Tested by

no test coverage detected