Skip to content

Commit 8fa108f

Browse files
committed
Merge branch 'PFM-4137' into PFM-4146
2 parents fbee36e + 4803ca3 commit 8fa108f

9 files changed

Lines changed: 36 additions & 42 deletions

File tree

.chainloop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This indicates the [current version]+next
22
# to indicate that we are building a new version of the project
3-
projectVersion: v1.74.0+next
3+
projectVersion: v1.74.1+next
44

55
# Experimental feature used by Chainloop labs shared workflow https://github.com/chainloop-dev/labs
66
# It maps the material names with location in disk so they get automatically attested

app/controlplane/api/gen/frontend/workflowcontract/v1/crafting_schema.ts

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/workflowcontract/v1/crafting_schema.pb.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/workflowcontract/v1/crafting_schema.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,13 @@ message PolicySpecV2 {
330330
string embedded = 2;
331331

332332
// generic reference for file:// and http(s):// schemes
333-
string ref = 3;
333+
string ref = 4;
334334

335335
option (buf.validate.oneof).required = true;
336336
}
337337

338338
// if set, it will match any material supported by Chainloop
339-
CraftingSchema.Material.MaterialType kind = 4 [(buf.validate.field).enum = {
339+
CraftingSchema.Material.MaterialType kind = 3 [(buf.validate.field).enum = {
340340
not_in: [3]
341341
}];
342342
}

app/controlplane/internal/service/organization.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,12 @@ func (s *OrganizationService) UpdateMembership(ctx context.Context, req *pb.Orga
214214
}
215215

216216
func (s *OrganizationService) canCreateOrganization(ctx context.Context) (bool, error) {
217-
// Restricted org creation is disabled, allow creation only to users
218-
if !s.authz.RestrictOrgCreation {
219-
if entities.CurrentMembership(ctx) != nil {
220-
return true, nil
221-
}
222-
return false, nil
217+
// if org creation restriction is disabled, allow creation to all users
218+
if !s.authz.RestrictOrgCreation && entities.CurrentUser(ctx) != nil {
219+
return true, nil
223220
}
224221

225-
// otherwise, check for permissions
222+
// otherwise, check for permissions (both users and API tokens)
226223
if err := s.checkPolicy(ctx, authz.PolicyOrganizationCreate); err != nil {
227224
return false, err
228225
}

app/controlplane/internal/service/service.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -331,22 +331,19 @@ func (s *service) visibleProjects(ctx context.Context) []uuid.UUID {
331331

332332
// checkPolicy Checks a policy against a user or a token
333333
func (s *service) checkPolicy(ctx context.Context, policy *authz.Policy) error {
334-
_, token, err := requireCurrentUserOrAPIToken(ctx)
335-
if err != nil {
336-
return err
337-
}
338-
339334
// Token case
340-
if token != nil {
341-
for _, p := range token.Policies {
342-
if p.Resource == policy.Resource && p.Action == policy.Action {
343-
return nil
344-
}
335+
sub := usercontext.CurrentAuthzSubject(ctx)
336+
if sub != "" {
337+
ok, err := s.authz.Enforce(ctx, sub, policy)
338+
if err != nil {
339+
return handleUseCaseErr(err, s.log)
340+
}
341+
if ok {
342+
return nil
345343
}
346-
return errors.Forbidden("forbidden", "not allowed")
347344
}
348345

349-
// user case
346+
// Other cases
350347
m := entities.CurrentMembership(ctx)
351348
if m == nil {
352349
return errors.Forbidden("forbidden", "not allowed")

deployment/chainloop/Chart.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ description: Chainloop is an open source software supply chain control plane, a
77

88
type: application
99
# Bump the patch (not minor, not major) version on each change in the Chart Source code
10-
version: 1.326.0
10+
version: 1.327.0
1111
# Do not update appVersion, this is handled automatically by the release process
12-
appVersion: v1.74.0
12+
appVersion: v1.74.1
1313

1414
dependencies:
1515
- name: common
@@ -33,11 +33,11 @@ dependencies:
3333

3434
annotations:
3535
images: |
36-
- image: ghcr.io/chainloop-dev/chainloop/artifact-cas:v1.74.0
36+
- image: ghcr.io/chainloop-dev/chainloop/artifact-cas:v1.74.1
3737
name: artifact-cas
38-
- image: ghcr.io/chainloop-dev/chainloop/control-plane:v1.74.0
38+
- image: ghcr.io/chainloop-dev/chainloop/control-plane:v1.74.1
3939
name: control-plane
40-
- image: ghcr.io/chainloop-dev/chainloop/control-plane-migrations:v1.74.0
40+
- image: ghcr.io/chainloop-dev/chainloop/control-plane-migrations:v1.74.1
4141
name: control-plane-migrations
42-
- image: ghcr.io/chainloop-dev/chainloop/cli:v1.74.0
42+
- image: ghcr.io/chainloop-dev/chainloop/cli:v1.74.1
4343
name: cli

deployment/chainloop/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ controlplane:
138138
image:
139139
registry: ghcr.io
140140
repository: chainloop-dev/chainloop/control-plane
141-
tag: "v1.74.0"
141+
tag: "v1.74.1"
142142

143143

144144
## @param controlplane.containerPorts.http controlplane HTTP container port
@@ -219,7 +219,7 @@ controlplane:
219219
image:
220220
registry: ghcr.io
221221
repository: chainloop-dev/chainloop/control-plane-migrations
222-
tag: "v1.74.0"
222+
tag: "v1.74.1"
223223
# Run the migration job forcing SSL, required in AWS RDS for PostgreSQL 15
224224
ssl: false
225225

@@ -996,7 +996,7 @@ cas:
996996
image:
997997
registry: ghcr.io
998998
repository: chainloop-dev/chainloop/artifact-cas
999-
tag: "v1.74.0"
999+
tag: "v1.74.1"
10001000

10011001
## @param cas.containerPorts.http controlplane HTTP container port
10021002
## @param cas.containerPorts.grpc controlplane gRPC container port

extras/dagger/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
const (
13-
chainloopVersion = "v1.74.0"
13+
chainloopVersion = "v1.74.1"
1414
)
1515

1616
var execOpts = dagger.ContainerWithExecOpts{

0 commit comments

Comments
 (0)