Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
1edf06a
create org member role and add project permissions
jiparis Jun 17, 2025
afc9001
wip
jiparis Jun 18, 2025
4b4cdd6
Merge branch 'main' into PFM-3163-member
jiparis Jun 18, 2025
d7a1271
expose role through CLI
jiparis Jun 18, 2025
f583b8f
set memberships
jiparis Jun 18, 2025
38f1973
cache membership data
jiparis Jun 18, 2025
c148162
fix tests
jiparis Jun 18, 2025
8287d0c
add enforcer to services
jiparis Jun 19, 2025
49ebead
attestation init
jiparis Jun 23, 2025
0e3c04e
att init complete
jiparis Jun 23, 2025
7d49b62
remove unused roles
jiparis Jun 23, 2025
b3d802e
reset cache
jiparis Jun 23, 2025
23bd36b
rbac on att push
jiparis Jun 23, 2025
fbb66f5
Merge branch 'main' into PFM-3163-member
jiparis Jun 23, 2025
9e1221d
add to att cancel
jiparis Jun 23, 2025
a4cb4e4
update permission to cancel attestations
jiparis Jun 23, 2025
bbfe593
workflows done
jiparis Jun 23, 2025
5366022
lint
jiparis Jun 23, 2025
f627687
fix error management
jiparis Jun 23, 2025
d62dc44
simplify
jiparis Jun 23, 2025
683b499
workflow run ls
jiparis Jun 23, 2025
908df49
wf run describe
jiparis Jun 23, 2025
da278d5
fix error check
jiparis Jun 23, 2025
f746d9d
remove change
jiparis Jun 23, 2025
e12257d
apply suggestions
jiparis Jun 23, 2025
ddf3908
add workflow contract permissions for member role
jiparis Jun 23, 2025
d3af968
inject project use case in all services
jiparis Jun 23, 2025
296a6bd
fix calls
jiparis Jun 23, 2025
7f2ed58
apply suggestions
jiparis Jun 23, 2025
9296e27
apply RBAC to remote attestations
jiparis Jun 23, 2025
0528079
casbackend ls
jiparis Jun 23, 2025
656a344
allow member invitations
jiparis Jun 23, 2025
9b34c1b
unify error messages
jiparis Jun 23, 2025
fdf606c
getuploadcreds
jiparis Jun 23, 2025
b324e72
attachments
jiparis Jun 24, 2025
6ea96d9
attachment detach
jiparis Jun 24, 2025
a6eb273
remove membership list
jiparis Jun 24, 2025
96cd018
metrics totals
jiparis Jun 24, 2025
453c66e
add role to org member
jiparis Jun 24, 2025
0faf6b2
org metrics are project-aware
jiparis Jun 24, 2025
2f7a607
undo change
jiparis Jun 24, 2025
f29a694
referrer
jiparis Jun 24, 2025
ae94ddd
undo change
jiparis Jun 24, 2025
164e0d2
fix test
jiparis Jun 24, 2025
6d6c91f
document roles
jiparis Jun 24, 2025
7a886d1
remove member from documentation
jiparis Jun 24, 2025
c276566
undocument member
jiparis Jun 24, 2025
13df2b2
lower expiration to 1 second
jiparis Jun 24, 2025
44bdfc8
fix integration detach
jiparis Jun 24, 2025
4224965
add commments
jiparis Jun 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/cli/cmd/organization_invitation_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func newOrganizationInvitationCreateCmd() *cobra.Command {
cmd.Flags().StringVar(&receiverEmail, "receiver", "", "Email of the user to invite")
err := cmd.MarkFlagRequired("receiver")

cmd.Flags().StringVar(&role, "role", string(action.RoleViewer), fmt.Sprintf("Role of the user in the organization, available %s", action.AvailableRoles))
cmd.Flags().StringVar(&role, "role", string(action.RoleViewer), fmt.Sprintf("Role of the user in the organization, available %s", action.AvailableRoles[:3]))
cobra.CheckErr(err)

return cmd
Expand Down
2 changes: 1 addition & 1 deletion app/cli/cmd/organization_member_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func newOrganizationMemberUpdateCmd() *cobra.Command {
err := cmd.MarkFlagRequired("id")
cobra.CheckErr(err)

cmd.Flags().StringVar(&role, "role", string(action.RoleViewer), fmt.Sprintf("Role of the user in the organization, available %s", action.AvailableRoles))
cmd.Flags().StringVar(&role, "role", string(action.RoleViewer), fmt.Sprintf("Role of the user in the organization, available %s", action.AvailableRoles[:3]))
cobra.CheckErr(err)

return cmd
Expand Down
6 changes: 6 additions & 0 deletions app/cli/internal/action/membership_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const (
RoleAdmin Role = "admin"
RoleOwner Role = "owner"
RoleViewer Role = "viewer"
RoleMember Role = "member"
)

type Roles []Role
Expand All @@ -125,6 +126,7 @@ var AvailableRoles = Roles{
RoleAdmin,
RoleOwner,
RoleViewer,
RoleMember,
}

func (roles Roles) String() string {
Expand All @@ -143,6 +145,8 @@ func pbRoleToString(role pb.MembershipRole) Role {
return RoleViewer
case pb.MembershipRole_MEMBERSHIP_ROLE_ORG_OWNER:
return RoleOwner
case pb.MembershipRole_MEMBERSHIP_ROLE_ORG_MEMBER:
return RoleMember
}
return ""
}
Expand All @@ -155,6 +159,8 @@ func stringToPbRole(role Role) pb.MembershipRole {
return pb.MembershipRole_MEMBERSHIP_ROLE_ORG_VIEWER
case RoleOwner:
return pb.MembershipRole_MEMBERSHIP_ROLE_ORG_OWNER
case RoleMember:
return pb.MembershipRole_MEMBERSHIP_ROLE_ORG_MEMBER
}
return pb.MembershipRole_MEMBERSHIP_ROLE_UNSPECIFIED
}
9 changes: 7 additions & 2 deletions app/controlplane/api/controlplane/v1/response_messages.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ enum MembershipRole {
MEMBERSHIP_ROLE_ORG_VIEWER = 1;
MEMBERSHIP_ROLE_ORG_ADMIN = 2;
MEMBERSHIP_ROLE_ORG_OWNER = 3;
MEMBERSHIP_ROLE_ORG_MEMBER = 4;
}

message OrgItem {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion app/controlplane/cmd/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ func newPolicyProviderConfig(in []*conf.PolicyProvider) []*policies.NewRegistryC
return out
}

func serviceOpts(l log.Logger) []service.NewOpt {
func serviceOpts(l log.Logger, enforcer *authz.Enforcer, pUC *biz.ProjectUseCase) []service.NewOpt {
return []service.NewOpt{
service.WithLogger(l),
service.WithEnforcer(enforcer),
service.WithProjectUseCase(pUC),
}
}

Expand Down
14 changes: 8 additions & 6 deletions app/controlplane/cmd/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion app/controlplane/internal/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"time"

crv1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/uuid"

"github.com/cenkalti/backoff/v4"

Expand Down Expand Up @@ -146,7 +147,12 @@ func (d *FanOutDispatcher) initDispatchQueue(ctx context.Context, orgID, workflo
queue := dispatchQueue{}

// List enabled integrations with this workflow
attachments, err := d.integrationUC.ListAttachments(ctx, orgID, workflowID)
wfUUID, err := uuid.Parse(workflowID)
if err != nil {
return nil, fmt.Errorf("parsing workflow ID: %w", err)
}

attachments, err := d.integrationUC.ListAttachments(ctx, orgID, &biz.ListAttachmentsOpts{WorkflowID: &wfUUID})
if err != nil {
return nil, fmt.Errorf("listing attachments: %w", err)
}
Expand Down
5 changes: 3 additions & 2 deletions app/controlplane/internal/server/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type Opts struct {
APITokenUseCase *biz.APITokenUseCase
OrganizationUseCase *biz.OrganizationUseCase
WorkflowUseCase *biz.WorkflowUseCase
MembershipUseCase *biz.MembershipUseCase
// Services
WorkflowSvc *service.WorkflowService
AuthSvc *service.AuthService
Expand Down Expand Up @@ -188,7 +189,7 @@ func craftMiddleware(opts *Opts) []middleware.Middleware {
usercontext.WithCurrentUserMiddleware(opts.UserUseCase, logHelper),
selector.Server(
// 2.c - Set its organization
usercontext.WithCurrentOrganizationMiddleware(opts.UserUseCase, logHelper),
usercontext.WithCurrentOrganizationMiddleware(opts.UserUseCase, opts.MembershipUseCase, logHelper),
// 3 - Check user/token authorization
authzMiddleware.WithAuthzMiddleware(opts.Enforcer, logHelper),
).Match(requireAllButOrganizationOperationsMatcher()).Build(),
Expand Down Expand Up @@ -223,7 +224,7 @@ func craftMiddleware(opts *Opts) []middleware.Middleware {
// 2.b - Set its API token and Robot Account as alternative to the user
usercontext.WithAttestationContextFromAPIToken(opts.APITokenUseCase, opts.OrganizationUseCase, logHelper),
// 2.c - Set Attestation context from user token
usercontext.WithAttestationContextFromUser(opts.UserUseCase, logHelper),
usercontext.WithAttestationContextFromUser(opts.UserUseCase, opts.MembershipUseCase, logHelper),
// 2.d - Set its robot account from federated delegation
usercontext.WithAttestationContextFromFederatedInfo(opts.OrganizationUseCase, logHelper),
).Match(requireRobotAccountMatcher()).Build(),
Expand Down
Loading
Loading