Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Auditing #105

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
- main
tags-ignore:
- '*'
env:
GO_VERSION: 1.21.5
jobs:
Coverage:
runs-on: ubuntu-latest
Expand All @@ -16,7 +14,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: true
- name: Install Helm
uses: azure/setup-helm@v3
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
- synchronize
- reopened
- ready_for_review
env:
GO_VERSION: 1.22.5
jobs:
Static:
runs-on: ubuntu-latest
Expand All @@ -17,7 +15,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: true
- name: Touch
run: make touch
Expand All @@ -35,7 +33,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: true
- name: Install Helm
uses: azure/setup-helm@v3
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
tags:
- '*'
env:
GO_VERSION: 1.22.5
REGISTRY: ghcr.io
jobs:
release:
Expand All @@ -19,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod
cache: true
- name: Install Helm
uses: azure/setup-helm@v3
Expand Down
4 changes: 2 additions & 2 deletions charts/identity/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: A Helm chart for deploying Unikorn's IdP

type: application

version: v0.2.28
appVersion: v0.2.28
version: v0.2.29
appVersion: v0.2.29

icon: https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/icon.png

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/oapi-codegen/runtime v1.1.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
github.com/unikorn-cloud/core v0.1.62
github.com/unikorn-cloud/core v0.1.63
go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0
go.opentelemetry.io/otel/sdk v1.28.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/unikorn-cloud/core v0.1.62 h1:EbXZxQxBIYjWC/LVLw8xAd46609u5GLc2DxnrZnLYxE=
github.com/unikorn-cloud/core v0.1.62/go.mod h1:Cd0zU1LrKo+OwnnCwuTQ+QL3yibnkjDHtkujfDM4AdE=
github.com/unikorn-cloud/core v0.1.63 h1:Jl/xuoGRKESMXhS1+apcaS/1I776agTyT75BGz9AKBA=
github.com/unikorn-cloud/core v0.1.63/go.mod h1:JcUIQW3+oiZPUQmOlENw3OCi35IBxPKa+J4MbP3TO7k=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand Down
6 changes: 4 additions & 2 deletions pkg/handler/groups/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,15 @@ func (c *Client) Update(ctx context.Context, organizationID, groupID string, req
return err
}

if err := conversion.UpdateObjectMetadata(required, current); err != nil {
return errors.OAuth2ServerError("failed to merge metadata").WithError(err)
}

updated := current.DeepCopy()
updated.Labels = required.Labels
updated.Annotations = required.Annotations
updated.Spec = required.Spec

conversion.UpdateObjectMetadata(updated, required)

if err := c.client.Patch(ctx, updated, client.MergeFrom(current)); err != nil {
return errors.OAuth2ServerError("failed to patch group").WithError(err)
}
Expand Down
6 changes: 4 additions & 2 deletions pkg/handler/oauth2providers/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,15 @@ func (c *Client) Update(ctx context.Context, organizationID, providerID string,

required := c.generate(ctx, organization, request)

if err := conversion.UpdateObjectMetadata(required, current); err != nil {
return errors.OAuth2ServerError("failed to merge metadata").WithError(err)
}

updated := current.DeepCopy()
updated.Labels = required.Labels
updated.Annotations = required.Annotations
updated.Spec = required.Spec

conversion.UpdateObjectMetadata(updated, required)

if err := c.client.Patch(ctx, updated, client.MergeFrom(current)); err != nil {
return errors.OAuth2ServerError("failed to patch oauth2 provider").WithError(err)
}
Expand Down
6 changes: 4 additions & 2 deletions pkg/handler/organizations/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,15 @@ func (c *Client) Update(ctx context.Context, organizationID string, request *ope

required := c.generate(ctx, request)

if err := conversion.UpdateObjectMetadata(required, current); err != nil {
return errors.OAuth2ServerError("failed to merge metadata").WithError(err)
}

updated := current.DeepCopy()
updated.Labels = required.Labels
updated.Annotations = required.Annotations
updated.Spec = required.Spec

conversion.UpdateObjectMetadata(updated, required)

if err := c.client.Patch(ctx, updated, client.MergeFrom(current)); err != nil {
return errors.OAuth2ServerError("failed to patch organization").WithError(err)
}
Expand Down
6 changes: 4 additions & 2 deletions pkg/handler/projects/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,15 @@ func (c *Client) Update(ctx context.Context, organizationID, projectID string, r
return err
}

if err := conversion.UpdateObjectMetadata(required, current); err != nil {
return errors.OAuth2ServerError("failed to merge metadata").WithError(err)
}

updated := current.DeepCopy()
updated.Labels = required.Labels
updated.Annotations = required.Annotations
updated.Spec = required.Spec

conversion.UpdateObjectMetadata(updated, required)

if err := c.client.Patch(ctx, updated, client.MergeFrom(current)); err != nil {
return errors.OAuth2ServerError("failed to patch project").WithError(err)
}
Expand Down
Loading