From 9e70b4c63e054be1e7dc4a4a690e12d9d101370a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 08:15:13 +0000 Subject: [PATCH 01/13] Bump google.golang.org/api from 0.152.0 to 0.153.0 (#258) Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.152.0 to 0.153.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.152.0...v0.153.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 91016473..8448b11f 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/prometheus/client_golang v1.17.0 github.com/prometheus/client_model v0.5.0 github.com/stretchr/testify v1.8.4 - google.golang.org/api v0.152.0 + google.golang.org/api v0.153.0 google.golang.org/grpc v1.59.0 google.golang.org/protobuf v1.31.0 k8s.io/api v0.28.4 diff --git a/go.sum b/go.sum index 2c80c917..ce14a0df 100644 --- a/go.sum +++ b/go.sum @@ -1122,8 +1122,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.152.0 h1:t0r1vPnfMc260S2Ci+en7kfCZaLOPs5KI0sVV/6jZrY= -google.golang.org/api v0.152.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= +google.golang.org/api v0.153.0 h1:N1AwGhielyKFaUqH07/ZSIQR3uNPcV7NVw0vj+j4iR4= +google.golang.org/api v0.153.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= From 77092c55b8d3554cd2be39be3e629d436d7fde1f Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Mon, 11 Dec 2023 14:45:00 +0100 Subject: [PATCH 02/13] Make token update opt-in (#261) --- .env.local | 2 + api/v1/apitoken_types_test.go | 11 +- charts/unleasherator/Feature.yaml | 4 + .../unleasherator/templates/deployment.yaml | 3 + charts/unleasherator/values.yaml | 1 + cmd/main.go | 11 +- config/default/manager_config_patch.yaml | 2 + config/samples/unleash_v1_unleash.yaml | 1 + controllers/apitoken_controller.go | 35 +++-- controllers/remoteunleash_controller_test.go | 4 +- controllers/suite_test.go | 9 +- pkg/config/config.go | 6 + pkg/unleashclient/admin_api_test.go | 130 +++++++++++++++++- ...nleash-admin-api-create-token-default.json | 13 ++ .../unleash-admin-api-create-token-star.json | 13 ++ .../unleash-admin-api-get-tokens.json | 65 +++++++++ 16 files changed, 284 insertions(+), 26 deletions(-) create mode 100644 .env.local create mode 100644 pkg/unleashclient/testdata/unleash-admin-api-create-token-default.json create mode 100644 pkg/unleashclient/testdata/unleash-admin-api-create-token-star.json create mode 100644 pkg/unleashclient/testdata/unleash-admin-api-get-tokens.json diff --git a/.env.local b/.env.local new file mode 100644 index 00000000..7f4c58ee --- /dev/null +++ b/.env.local @@ -0,0 +1,2 @@ +LEADER_ELECTION_ENABLED=false +OPERATOR_NAMESPACE=unleasherator-system diff --git a/api/v1/apitoken_types_test.go b/api/v1/apitoken_types_test.go index 273df5cc..60b17c29 100644 --- a/api/v1/apitoken_types_test.go +++ b/api/v1/apitoken_types_test.go @@ -89,8 +89,17 @@ func TestApiToken_IsEqual(t *testing.T) { unleashToken.Environment = "production" assert.False(t, apiToken.ApiTokenIsEqual(unleashToken)) - // Test when the tokens have different projects + // Test when the tokens have same projects but in different order unleashToken.Environment = "development" + unleashToken.Projects = []string{"project2", "project1"} + assert.True(t, apiToken.ApiTokenIsEqual(unleashToken)) + + // Test when the tokens have different projects unleashToken.Projects = []string{"project1", "project3"} assert.False(t, apiToken.ApiTokenIsEqual(unleashToken)) + + // Test when the tokens are wildcards + apiToken.Spec.Projects = []string{"*"} + unleashToken.Projects = []string{"*"} + assert.True(t, apiToken.ApiTokenIsEqual(unleashToken)) } diff --git a/charts/unleasherator/Feature.yaml b/charts/unleasherator/Feature.yaml index 94a45a4b..4e0b3392 100644 --- a/charts/unleasherator/Feature.yaml +++ b/charts/unleasherator/Feature.yaml @@ -31,6 +31,10 @@ values: computed: template: | iam.gke.io/gcp-service-account: "{{ .Env.unleasherator_service_account }}" + # Features + controllerManager.manager.env.featureApiTokenUpdateEnabled: + config: + type: bool # Onprem stuff controllerManagerGcp.serviceAccountCredentialsJson: computed: diff --git a/charts/unleasherator/templates/deployment.yaml b/charts/unleasherator/templates/deployment.yaml index aebe2851..0cf24b60 100644 --- a/charts/unleasherator/templates/deployment.yaml +++ b/charts/unleasherator/templates/deployment.yaml @@ -56,6 +56,9 @@ spec: - name: FEDERATION_PUBSUB_SUBSCRIPTION value: {{ quote .Values.controllerManager.manager.env.federationPubsubSubscription }} + - name: FEATURE_API_TOKEN_UPDATE_ENABLED + value: {{ quote .Values.controllerManager.manager.env.featureApiTokenUpdateEnabled + }} - name: HTTPS_PROXY value: {{ quote .Values.controllerManager.manager.env.httpsProxy }} - name: NO_PROXY diff --git a/charts/unleasherator/values.yaml b/charts/unleasherator/values.yaml index b567db88..3dd25f76 100644 --- a/charts/unleasherator/values.yaml +++ b/charts/unleasherator/values.yaml @@ -32,6 +32,7 @@ controllerManager: type: RuntimeDefault env: apiTokenNameSuffix: unleasherator + featureApiTokenUpdateEnabled: "false" federationClusterName: "" federationPubsubGcpProjectId: "" federationPubsubMode: "" diff --git a/cmd/main.go b/cmd/main.go index b167dfa5..ddcdfd63 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -120,11 +120,12 @@ func main() { os.Exit(1) } if err = (&controllers.ApiTokenReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - Recorder: mgr.GetEventRecorderFor("api-token-controller"), - OperatorNamespace: cfg.OperatorNamespace, - ApiTokenNameSuffix: cfg.ApiTokenNameSuffix, + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + Recorder: mgr.GetEventRecorderFor("api-token-controller"), + OperatorNamespace: cfg.OperatorNamespace, + ApiTokenNameSuffix: cfg.ApiTokenNameSuffix, + ApiTokenUpdateEnabled: cfg.Features.ApiTokenUpdateEnabled, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create controller", "controller", "ApiToken") os.Exit(1) diff --git a/config/default/manager_config_patch.yaml b/config/default/manager_config_patch.yaml index 611702c7..82bc2968 100644 --- a/config/default/manager_config_patch.yaml +++ b/config/default/manager_config_patch.yaml @@ -23,6 +23,8 @@ spec: value: "" - name: FEDERATION_PUBSUB_SUBSCRIPTION value: "" + - name: "FEATURE_API_TOKEN_UPDATE_ENABLED" + value: "false" - name: HTTPS_PROXY value: "" - name: NO_PROXY diff --git a/config/samples/unleash_v1_unleash.yaml b/config/samples/unleash_v1_unleash.yaml index 7a583e57..4be32593 100644 --- a/config/samples/unleash_v1_unleash.yaml +++ b/config/samples/unleash_v1_unleash.yaml @@ -10,6 +10,7 @@ metadata: name: unleash-sample spec: size: 1 + customImage: unleashorg/unleash-server:5 database: secretName: postgres-postgresql secretPassKey: postgres-password diff --git a/controllers/apitoken_controller.go b/controllers/apitoken_controller.go index 8bedbec2..3b98180d 100644 --- a/controllers/apitoken_controller.go +++ b/controllers/apitoken_controller.go @@ -53,6 +53,11 @@ type ApiTokenReconciler struct { // in order to avoid name collisions when multiple clusters are // using the same Unleash instance. ApiTokenNameSuffix string + + // ApiTokenUpdateEnabled enables updating tokens in Unleash since + // tokens in Unleash are immutable. This is a feature flag that + // can be enabled in the operator config. + ApiTokenUpdateEnabled bool } //+kubebuilder:rbac:groups=unleash.nais.io,resources=apitokens,verbs=get;list;watch;create;update;patch;delete @@ -234,23 +239,29 @@ func (r *ApiTokenReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c // Update token if it differs from the desired state // Tokens in Unleash are immutable, so we need to delete the old token and create a new one if apiToken != nil && !token.ApiTokenIsEqual(apiToken) { - log.Info("Updating token in Unleash for ApiToken") - log.Info("Deleting old token in Unleash for ApiToken") - err = apiClient.DeleteApiToken(token.ApiTokenName(r.ApiTokenNameSuffix)) - if err != nil { - if err := r.updateStatusFailed(ctx, token, err, "TokenUpdateFailed", "Failed to delete old token in Unleash"); err != nil { + log.Info(fmt.Sprintf("Token in Kubernetes: type=%s, environment=%s, projects=%s", token.Spec.Type, token.Spec.Environment, token.Spec.Projects)) + log.Info(fmt.Sprintf("Token in Unleash: type=%s, environment=%s, projects=%s", apiToken.Type, apiToken.Environment, apiToken.Projects)) + + if r.ApiTokenUpdateEnabled { + log.Info("Deleting old token in Unleash for ApiToken") + err = apiClient.DeleteApiToken(token.ApiTokenName(r.ApiTokenNameSuffix)) + if err != nil { + if err := r.updateStatusFailed(ctx, token, err, "TokenUpdateFailed", "Failed to delete old token in Unleash"); err != nil { + return ctrl.Result{}, err + } return ctrl.Result{}, err } - return ctrl.Result{}, err - } - log.Info("Creating new token in Unleash for ApiToken") - apiToken, err = apiClient.CreateAPIToken(token.ApiTokenRequest(r.ApiTokenNameSuffix)) - if err != nil { - if err := r.updateStatusFailed(ctx, token, err, "TokenUpdateFailed", "Failed to create new token in Unleash"); err != nil { + log.Info("Creating new token in Unleash for ApiToken") + apiToken, err = apiClient.CreateAPIToken(token.ApiTokenRequest(r.ApiTokenNameSuffix)) + if err != nil { + if err := r.updateStatusFailed(ctx, token, err, "TokenUpdateFailed", "Failed to create new token in Unleash"); err != nil { + return ctrl.Result{}, err + } return ctrl.Result{}, err } - return ctrl.Result{}, err + } else { + log.Info("Token update is disabled in operator config") } } diff --git a/controllers/remoteunleash_controller_test.go b/controllers/remoteunleash_controller_test.go index ea0c59bc..805cf51f 100644 --- a/controllers/remoteunleash_controller_test.go +++ b/controllers/remoteunleash_controller_test.go @@ -107,7 +107,9 @@ var _ = Describe("RemoteUnleash controller", func() { Expect(promGaugeVecVal(remoteUnleashStatus, RemoteUnleashNamespace, RemoteUnleashName, unleashv1.UnleashStatusConditionTypeConnected)).To(Equal(1.0)) Expect(httpmock.GetCallCountInfo()).To(HaveLen(1)) - Expect(httpmock.GetCallCountInfo()[fmt.Sprintf("GET %s", unleashclient.InstanceAdminStatsEndpoint)]).To(Equal(1)) + // This should ideally be 1, but due "object has been modified; please apply your changes to the latest version and try again" error + // it can be 2 or more as the reconciler retries. + Expect(httpmock.GetCallCountInfo()[fmt.Sprintf("GET %s", unleashclient.InstanceAdminStatsEndpoint)]).ToNot(Equal(0)) }) }) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 41250b2a..7fec6cf5 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -119,10 +119,11 @@ var _ = BeforeSuite(func() { Expect(err).ToNot(HaveOccurred()) err = (&ApiTokenReconciler{ - Client: k8sManager.GetClient(), - Scheme: k8sManager.GetScheme(), - OperatorNamespace: operatorNamespace, - ApiTokenNameSuffix: ApiTokenNameSuffix, + Client: k8sManager.GetClient(), + Scheme: k8sManager.GetScheme(), + OperatorNamespace: operatorNamespace, + ApiTokenNameSuffix: ApiTokenNameSuffix, + ApiTokenUpdateEnabled: true, }).SetupWithManager(k8sManager) Expect(err).ToNot(HaveOccurred()) diff --git a/pkg/config/config.go b/pkg/config/config.go index 5235a8d0..db51840d 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -44,6 +44,12 @@ type Config struct { OperatorNamespace string `envconfig:"OPERATOR_NAMESPACE"` Timeout TimeoutConfig WebhookPort int `envconfig:"WEBHOOK_PORT" default:"9443"` + Features Features +} + +type Features struct { + // UnleashTokenUpdate enables updating tokens in Unleash. + ApiTokenUpdateEnabled bool `envconfig:"FEATURE_API_TOKEN_UPDATE_ENABLED" default:"false"` } func (c *Config) ManagerOptions(scheme *runtime.Scheme) manager.Options { diff --git a/pkg/unleashclient/admin_api_test.go b/pkg/unleashclient/admin_api_test.go index a976c50a..bbd704fc 100644 --- a/pkg/unleashclient/admin_api_test.go +++ b/pkg/unleashclient/admin_api_test.go @@ -2,8 +2,11 @@ package unleashclient import ( "encoding/json" + "net/http" + "os" "testing" + "github.com/jarcoal/httpmock" "github.com/stretchr/testify/assert" ) @@ -52,7 +55,7 @@ func TestInstanceAdminStatsResult(t *testing.T) { } func TestApiToken(t *testing.T) { - jsonString := `{"tokenName":"my-token","type":"client","environment":"development","projects":["default"],"secret":"default:development.0000000000000000000000000000000000000000000000000000000000000000","username":"my-token","alias":null,"project":"default","createdAt":"2023-12-08T11:36:52.035Z"}` + jsonString := `{"tokenName":"my-token","type":"client","environment":"development","projects":["default"],"secret":"default:development.00000","username":"my-token","alias":null,"project":"default","createdAt":"2023-12-08T11:36:52.035Z"}` var result ApiToken err := json.Unmarshal([]byte(jsonString), &result) if err != nil { @@ -63,15 +66,24 @@ func TestApiToken(t *testing.T) { assert.Equal(t, "client", result.Type) assert.Equal(t, "development", result.Environment) assert.Equal(t, "default", result.Projects[0]) - assert.Equal(t, "default:development.0000000000000000000000000000000000000000000000000000000000000000", result.Secret) + assert.Equal(t, "default:development.00000", result.Secret) assert.Equal(t, "my-token", result.Username) assert.Equal(t, "", result.Alias) assert.Equal(t, "default", result.Project) assert.Equal(t, "2023-12-08T11:36:52.035Z", result.CreatedAt) + + jsonString = `{"tokenName":"my-token-star","type":"client","environment":"development","projects":["*"],"secret":"*:development.00000","username":"my-token-star","alias":null,"project":"*","createdAt":"2023-12-11T09:17:59.680Z"}` + err = json.Unmarshal([]byte(jsonString), &result) + if err != nil { + t.Errorf("Error unmarshalling json: %s", err) + } + + assert.Equal(t, "*", result.Projects[0]) + assert.Equal(t, "*", result.Project) } func TestApiTokenResult(t *testing.T) { - jsonString := `{"tokens":[{"secret":"default:development.0000000000000000000000000000000000000000000000000000000000000000","tokenName":"token-a","type":"client","project":"default","projects":["default"],"environment":"development","expiresAt":null,"createdAt":"2023-12-08T09:23:19.962Z","alias":null,"seenAt":null,"username":"token-a"},{"secret":"*:production.0000000000000000000000000000000000000000000000000000000000000000","tokenName":"token-b","type":"client","project":"*","projects":["*"],"environment":"production","expiresAt":null,"createdAt":"2023-12-07T08:58:25.547Z","alias":null,"seenAt":null,"username":"token-b"},{"secret":"*:*.0000000000000000000000000000000000000000000000000000000000000000","tokenName":"admin","type":"admin","project":"*","projects":["*"],"environment":"*","expiresAt":null,"createdAt":"2023-05-31T06:54:22.698Z","alias":null,"seenAt":"2023-12-08T12:35:14.627Z","username":"admin"}]}` + jsonString := `{"tokens":[{"secret":"default:development.00000","tokenName":"token-a","type":"client","project":"default","projects":["default"],"environment":"development","expiresAt":null,"createdAt":"2023-12-08T09:23:19.962Z","alias":null,"seenAt":null,"username":"token-a"},{"secret":"*:production.00000","tokenName":"token-b","type":"client","project":"*","projects":["*"],"environment":"production","expiresAt":null,"createdAt":"2023-12-07T08:58:25.547Z","alias":null,"seenAt":null,"username":"token-b"},{"secret":"*:*.00000","tokenName":"admin","type":"admin","project":"*","projects":["*"],"environment":"*","expiresAt":null,"createdAt":"2023-05-31T06:54:22.698Z","alias":null,"seenAt":"2023-12-08T12:35:14.627Z","username":"admin"}]}` var result ApiTokenResult err := json.Unmarshal([]byte(jsonString), &result) if err != nil { @@ -80,3 +92,115 @@ func TestApiTokenResult(t *testing.T) { assert.Equal(t, 3, len(result.Tokens)) } +func TestClient_GetAPIToken(t *testing.T) { + httpmock.Activate() + defer httpmock.DeactivateAndReset() + httpmock.RegisterResponder("GET", "/api/admin/api-tokens", func(req *http.Request) (*http.Response, error) { + jsonData, err := os.ReadFile("testdata/unleash-admin-api-get-tokens.json") + if err != nil { + return httpmock.NewStringResponse(500, ""), err + } + + return httpmock.NewBytesResponse(200, jsonData), nil + }) + + client, err := NewClient("http://unleash.example.com", "token") + assert.NoError(t, err) + + t.Run("Token for default project exists", func(t *testing.T) { + expectedToken := &ApiToken{ + Secret: "default:development.00000", + TokenName: "token-default", + Type: "client", + Project: "default", + Projects: []string{"default"}, + Environment: "development", + CreatedAt: "2023-12-08T09:23:19.962Z", + Username: "token-default", + } + + token, err := client.GetAPIToken("token-default") + assert.NoError(t, err) + assert.Equal(t, expectedToken, token) + }) + + t.Run("Token for wildcard (*) project exists", func(t *testing.T) { + expectedToken := &ApiToken{ + Secret: "*:production.00000", + TokenName: "token-wildcard", + Type: "client", + Project: "*", + Projects: []string{"*"}, + Environment: "production", + CreatedAt: "2023-12-07T08:58:25.547Z", + Username: "token-wildcard", + } + + token, err := client.GetAPIToken("token-wildcard") + assert.NoError(t, err) + assert.Equal(t, expectedToken, token) + }) + + t.Run("Token with multiple projects exists", func(t *testing.T) { + expectedToken := &ApiToken{ + Secret: "project-a:development.00000", + TokenName: "token-multi-projects", + Type: "client", + Project: "project-a", + Projects: []string{"project-a", "project-b"}, + Environment: "development", + CreatedAt: "2023-12-07T08:58:25.547Z", + Username: "token-multi-projects", + } + + token, err := client.GetAPIToken("token-multi-projects") + assert.NoError(t, err) + assert.Equal(t, expectedToken, token) + }) + + t.Run("Token does not exist", func(t *testing.T) { + token, err := client.GetAPIToken("non-existent-user") + assert.NoError(t, err) + assert.Nil(t, token) + }) +} + +func TestClient_CreateAPIToken(t *testing.T) { + client, err := NewClient("http://unleash.example.com", "token") + assert.NoError(t, err) + + t.Run("Should create token for default project", func(t *testing.T) { + httpmock.Activate() + defer httpmock.DeactivateAndReset() + httpmock.RegisterResponder("POST", "/api/admin/api-tokens", func(req *http.Request) (*http.Response, error) { + jsonData, err := os.ReadFile("testdata/unleash-admin-api-create-token-default.json") + if err != nil { + return httpmock.NewStringResponse(500, ""), err + } + + return httpmock.NewBytesResponse(201, jsonData), nil + }) + + tokenRequest := ApiTokenRequest{ + Username: "my-token-default", + Type: "client", + Environment: "development", + Projects: []string{"default"}, + } + + expectedToken := &ApiToken{ + Secret: "default:development.00000", + TokenName: "my-token-default", + Type: "client", + Project: "default", + Projects: []string{"default"}, + Environment: "development", + CreatedAt: "2023-12-11T10:21:28.088Z", + Username: "my-token-default", + } + + token, err := client.CreateAPIToken(tokenRequest) + assert.NoError(t, err) + assert.Equal(t, expectedToken, token) + }) +} diff --git a/pkg/unleashclient/testdata/unleash-admin-api-create-token-default.json b/pkg/unleashclient/testdata/unleash-admin-api-create-token-default.json new file mode 100644 index 00000000..fcf36c1f --- /dev/null +++ b/pkg/unleashclient/testdata/unleash-admin-api-create-token-default.json @@ -0,0 +1,13 @@ +{ + "tokenName": "my-token-default", + "type": "client", + "environment": "development", + "projects": [ + "default" + ], + "secret": "default:development.00000", + "username": "my-token-default", + "alias": null, + "project": "default", + "createdAt": "2023-12-11T10:21:28.088Z" +} \ No newline at end of file diff --git a/pkg/unleashclient/testdata/unleash-admin-api-create-token-star.json b/pkg/unleashclient/testdata/unleash-admin-api-create-token-star.json new file mode 100644 index 00000000..f1ec7da5 --- /dev/null +++ b/pkg/unleashclient/testdata/unleash-admin-api-create-token-star.json @@ -0,0 +1,13 @@ +{ + "tokenName": "my-token-star", + "type": "client", + "environment": "development", + "projects": [ + "*" + ], + "secret": "*:development.00000", + "username": "my-token-star", + "alias": null, + "project": "*", + "createdAt": "2023-12-11T10:20:40.331Z" +} \ No newline at end of file diff --git a/pkg/unleashclient/testdata/unleash-admin-api-get-tokens.json b/pkg/unleashclient/testdata/unleash-admin-api-get-tokens.json new file mode 100644 index 00000000..27e65626 --- /dev/null +++ b/pkg/unleashclient/testdata/unleash-admin-api-get-tokens.json @@ -0,0 +1,65 @@ +{ + "tokens": [ + { + "secret": "default:development.00000", + "tokenName": "token-default", + "type": "client", + "project": "default", + "projects": [ + "default" + ], + "environment": "development", + "expiresAt": null, + "createdAt": "2023-12-08T09:23:19.962Z", + "alias": null, + "seenAt": null, + "username": "token-default" + }, + { + "secret": "*:production.00000", + "tokenName": "token-wildcard", + "type": "client", + "project": "*", + "projects": [ + "*" + ], + "environment": "production", + "expiresAt": null, + "createdAt": "2023-12-07T08:58:25.547Z", + "alias": null, + "seenAt": null, + "username": "token-wildcard" + }, + { + "secret": "project-a:development.00000", + "tokenName": "token-multi-projects", + "type": "client", + "project": "project-a", + "projects": [ + "project-a", + "project-b" + ], + "environment": "development", + "expiresAt": null, + "createdAt": "2023-12-07T08:58:25.547Z", + "alias": null, + "seenAt": null, + "username": "token-multi-projects" + }, + { + "secret": "*:*.00000", + "tokenName": "admin", + "type": "admin", + "project": "*", + "projects": [ + "*" + ], + "environment": "*", + "expiresAt": null, + "createdAt": "2023-05-31T06:54:22.698Z", + "alias": null, + "seenAt": "2023-12-11T09:10:52.906Z", + "username": "admin" + } + ] +} \ No newline at end of file From 3c7bdee12612fad4def71ab8c53e64d6ab0b50d2 Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Mon, 11 Dec 2023 15:13:58 +0100 Subject: [PATCH 03/13] Ignore casing for token type when comparing (#262) --- api/v1/apitoken_types.go | 4 +++- api/v1/apitoken_types_test.go | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/api/v1/apitoken_types.go b/api/v1/apitoken_types.go index 3b6138dd..e983ca27 100644 --- a/api/v1/apitoken_types.go +++ b/api/v1/apitoken_types.go @@ -1,6 +1,8 @@ package unleash_nais_io_v1 import ( + "strings" + "github.com/nais/unleasherator/pkg/unleashclient" "github.com/nais/unleasherator/pkg/utils" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -123,7 +125,7 @@ func (t *ApiToken) ApiTokenRequest(suffix string) unleashclient.ApiTokenRequest } func (t *ApiToken) ApiTokenIsEqual(token *unleashclient.ApiToken) bool { - return t.Spec.Type == token.Type && + return strings.EqualFold(t.Spec.Type, token.Type) && t.Spec.Environment == token.Environment && utils.StringSliceEquals(t.Spec.Projects, token.Projects) } diff --git a/api/v1/apitoken_types_test.go b/api/v1/apitoken_types_test.go index 60b17c29..68d4cbbe 100644 --- a/api/v1/apitoken_types_test.go +++ b/api/v1/apitoken_types_test.go @@ -65,7 +65,7 @@ func TestApiToken_NamespacedName(t *testing.T) { func TestApiToken_IsEqual(t *testing.T) { apiToken := &ApiToken{ Spec: ApiTokenSpec{ - Type: "client", + Type: "CLIENT", Environment: "development", Projects: []string{"project1", "project2"}, }, @@ -77,15 +77,19 @@ func TestApiToken_IsEqual(t *testing.T) { Projects: []string{"project1", "project2"}, } + // Test when the token types are case different + apiToken.Spec.Type = "ClIeNt" + assert.True(t, apiToken.ApiTokenIsEqual(unleashToken)) + // Test when the tokens are equal assert.True(t, apiToken.ApiTokenIsEqual(unleashToken)) // Test when the tokens have different types - unleashToken.Type = "server" + unleashToken.Type = "FRONTEND" assert.False(t, apiToken.ApiTokenIsEqual(unleashToken)) // Test when the tokens have different environments - unleashToken.Type = "client" + unleashToken.Type = "CLIENT" unleashToken.Environment = "production" assert.False(t, apiToken.ApiTokenIsEqual(unleashToken)) From 22228170d4a8f63c3b9e1592082434944a7c64d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 08:24:58 +0000 Subject: [PATCH 04/13] Bump github.com/google/uuid from 1.4.0 to 1.5.0 (#264) Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.4.0 to 1.5.0. - [Release notes](https://github.com/google/uuid/releases) - [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) --- updated-dependencies: - dependency-name: github.com/google/uuid dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8448b11f..cbab1e70 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( cloud.google.com/go/pubsub v1.33.0 github.com/go-logr/logr v1.3.0 github.com/golangci/golangci-lint v1.55.2 - github.com/google/uuid v1.4.0 + github.com/google/uuid v1.5.0 github.com/jarcoal/httpmock v1.3.1 github.com/kelseyhightower/envconfig v1.4.0 github.com/onsi/ginkgo/v2 v2.13.2 diff --git a/go.sum b/go.sum index ce14a0df..02fc801e 100644 --- a/go.sum +++ b/go.sum @@ -384,8 +384,8 @@ github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= From 83116655d96e23f448eb4ca2159300c5a425dd85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 08:30:44 +0000 Subject: [PATCH 05/13] Bump google.golang.org/grpc from 1.59.0 to 1.60.0 (#266) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.59.0 to 1.60.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.59.0...v1.60.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cbab1e70..09a4968d 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/prometheus/client_model v0.5.0 github.com/stretchr/testify v1.8.4 google.golang.org/api v0.153.0 - google.golang.org/grpc v1.59.0 + google.golang.org/grpc v1.60.0 google.golang.org/protobuf v1.31.0 k8s.io/api v0.28.4 k8s.io/apimachinery v0.28.4 diff --git a/go.sum b/go.sum index 02fc801e..a4001875 100644 --- a/go.sum +++ b/go.sum @@ -1196,8 +1196,8 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= +google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 89e7103fced2cf445411d22b111291a381f923d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 08:35:20 +0000 Subject: [PATCH 06/13] Bump google.golang.org/api from 0.153.0 to 0.154.0 (#265) Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.153.0 to 0.154.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.153.0...v0.154.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 25 ++++++++++++++++--------- go.sum | 55 +++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 53 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 09a4968d..da50b67d 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/prometheus/client_golang v1.17.0 github.com/prometheus/client_model v0.5.0 github.com/stretchr/testify v1.8.4 - google.golang.org/api v0.153.0 + google.golang.org/api v0.154.0 google.golang.org/grpc v1.60.0 google.golang.org/protobuf v1.31.0 k8s.io/api v0.28.4 @@ -33,10 +33,17 @@ require ( github.com/alecthomas/go-check-sumtype v0.1.3 // indirect github.com/catenacyber/perfsprint v0.2.0 // indirect github.com/ccojocar/zxcvbn-go v1.0.1 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/ghostiam/protogetter v0.2.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/macabu/inamedparam v0.1.2 // indirect go-simpler.org/sloglint v0.1.2 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect ) require ( @@ -224,23 +231,23 @@ require ( go.tmz.dev/musttag v0.7.2 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.16.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect golang.org/x/mod v0.13.0 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/oauth2 v0.14.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.15.0 // indirect golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.14.0 // indirect - golang.org/x/term v0.14.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.14.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index a4001875..5213431b 100644 --- a/go.sum +++ b/go.sum @@ -159,6 +159,8 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/containerd/containerd v1.6.15 h1:4wWexxzLNHNE46aIETc6ge4TofO550v+BlLoANrbses= github.com/containerd/containerd v1.6.15/go.mod h1:U2NnBPIhzJDm59xF7xB2MMHnKtggpZ+phKg8o2TKj2c= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -198,6 +200,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= @@ -212,6 +216,8 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= @@ -240,9 +246,12 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= @@ -790,6 +799,16 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= @@ -815,8 +834,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -908,8 +927,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -920,8 +939,8 @@ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -995,16 +1014,16 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= -golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1122,8 +1141,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.153.0 h1:N1AwGhielyKFaUqH07/ZSIQR3uNPcV7NVw0vj+j4iR4= -google.golang.org/api v0.153.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= +google.golang.org/api v0.154.0 h1:X7QkVKZBskztmpPKWQXgjJRPA2dJYrL6r+sYPRLj050= +google.golang.org/api v0.154.0/go.mod h1:qhSMkM85hgqiokIYsrRyKxrjfBeIhgl4Z2JmeRkYylc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1171,12 +1190,12 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= -google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f/go.mod h1:nWSwAFPb+qfNJXsoeO3Io7zf4tMSfN8EA8RlDA04GhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= From 807587486bd922c5a2c6762dfcbdf11c62e434c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 09:52:17 +0100 Subject: [PATCH 07/13] Bump the actions group with 6 updates (#267) Bumps the actions group with 6 updates: | Package | From | To | | --- | --- | --- | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `3` | `4` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `3.0.2` | `4.0.0` | | [actions/setup-python](https://github.com/actions/setup-python) | `4` | `5` | | [google-github-actions/setup-gcloud](https://github.com/google-github-actions/setup-gcloud) | `1` | `2` | | [github/codeql-action](https://github.com/github/codeql-action) | `2` | `3` | | [actions/setup-go](https://github.com/actions/setup-go) | `4` | `5` | Updates `actions/upload-artifact` from 3 to 4 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) Updates `actions/download-artifact` from 3.0.2 to 4.0.0 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3.0.2...v4.0.0) Updates `actions/setup-python` from 4 to 5 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) Updates `google-github-actions/setup-gcloud` from 1 to 2 - [Release notes](https://github.com/google-github-actions/setup-gcloud/releases) - [Changelog](https://github.com/google-github-actions/setup-gcloud/blob/main/CHANGELOG.md) - [Commits](https://github.com/google-github-actions/setup-gcloud/compare/v1...v2) Updates `github/codeql-action` from 2 to 3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) Updates `actions/setup-go` from 4 to 5 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: google-github-actions/setup-gcloud dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/chart.yaml | 20 ++++++++++---------- .github/workflows/codeql.yml | 6 +++--- .github/workflows/image.yml | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/chart.yaml b/.github/workflows/chart.yaml index 509fe47b..075bb97e 100644 --- a/.github/workflows/chart.yaml +++ b/.github/workflows/chart.yaml @@ -54,21 +54,21 @@ jobs: cat ./charts/${{ steps.name.outputs.name }}/values.yaml - name: Save Chart Metadata - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: chart-metadata path: | ./charts/${{ steps.name.outputs.name }}/Chart.yaml - name: Save Chart Values - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: chart-values path: | ./charts/${{ steps.name.outputs.name }}/values.yaml - name: Save CRDs Chart Metadata - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: crds-chart-metadata path: | @@ -84,13 +84,13 @@ jobs: fetch-depth: 0 - name: Restore Chart Metadata - uses: actions/download-artifact@v3.0.2 + uses: actions/download-artifact@v4.0.0 with: name: chart-metadata path: ./charts/${{ needs.meta.outputs.name }} - name: Restore CRDs Chart Metadata - uses: actions/download-artifact@v3.0.2 + uses: actions/download-artifact@v4.0.0 with: name: crds-chart-metadata path: ./charts/${{ needs.meta.outputs.name }}-crds @@ -100,7 +100,7 @@ jobs: with: version: ${{ env.HELM_VERSION }} - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} check-latest: true @@ -171,19 +171,19 @@ jobs: fetch-depth: 0 - name: Restore Chart Metadata - uses: actions/download-artifact@v3.0.2 + uses: actions/download-artifact@v4.0.0 with: name: chart-metadata path: ./charts/${{ needs.meta.outputs.name }} - name: Restore Chart Values - uses: actions/download-artifact@v3.0.2 + uses: actions/download-artifact@v4.0.0 with: name: chart-values path: ./charts/${{ needs.meta.outputs.name }} - name: Restore CRDs Chart Metadata - uses: actions/download-artifact@v3.0.2 + uses: actions/download-artifact@v4.0.0 with: name: crds-chart-metadata path: ./charts/${{ needs.meta.outputs.name }}-crds @@ -198,7 +198,7 @@ jobs: token_format: access_token - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v1 + uses: google-github-actions/setup-gcloud@v2 - name: Log in to Google Artifact Registry if: github.actor != 'dependabot[bot]' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2c92c927..93710ab5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -57,7 +57,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -71,7 +71,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -84,6 +84,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 4268fb47..64c1025c 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -45,7 +45,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Set up Go environment - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: "1.21" cache: false @@ -67,7 +67,7 @@ jobs: path: ${{ github.workspace }}/bin key: ${{ runner.os }}-bin-${{ hashFiles('Makefile', 'go.mod') }} - name: Set up Go environment - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: "1.21" use-latest: true From 2c08f608afddf1a7a757c83b99b8983ba774a1eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:14:37 +0000 Subject: [PATCH 08/13] Bump golang.org/x/crypto from 0.16.0 to 0.17.0 (#268) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.16.0 to 0.17.0. - [Commits](https://github.com/golang/crypto/compare/v0.16.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index da50b67d..a88f20d0 100644 --- a/go.mod +++ b/go.mod @@ -231,7 +231,7 @@ require ( go.tmz.dev/musttag v0.7.2 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect golang.org/x/mod v0.13.0 // indirect diff --git a/go.sum b/go.sum index 5213431b..fd7ea923 100644 --- a/go.sum +++ b/go.sum @@ -834,8 +834,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= From e6f2faae7aa660aaba3f0142caad8559ea7ebf0b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:28:35 +0000 Subject: [PATCH 09/13] Bump the actions group with 1 update (#269) Bumps the actions group with 1 update: [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/download-artifact` from 4.0.0 to 4.1.0 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4.0.0...v4.1.0) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/chart.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/chart.yaml b/.github/workflows/chart.yaml index 075bb97e..b4c6fd84 100644 --- a/.github/workflows/chart.yaml +++ b/.github/workflows/chart.yaml @@ -84,13 +84,13 @@ jobs: fetch-depth: 0 - name: Restore Chart Metadata - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.0 with: name: chart-metadata path: ./charts/${{ needs.meta.outputs.name }} - name: Restore CRDs Chart Metadata - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.0 with: name: crds-chart-metadata path: ./charts/${{ needs.meta.outputs.name }}-crds @@ -171,19 +171,19 @@ jobs: fetch-depth: 0 - name: Restore Chart Metadata - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.0 with: name: chart-metadata path: ./charts/${{ needs.meta.outputs.name }} - name: Restore Chart Values - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.0 with: name: chart-values path: ./charts/${{ needs.meta.outputs.name }} - name: Restore CRDs Chart Metadata - uses: actions/download-artifact@v4.0.0 + uses: actions/download-artifact@v4.1.0 with: name: crds-chart-metadata path: ./charts/${{ needs.meta.outputs.name }}-crds From 9ce9e15a9eeec8c0bfe5c3f5110268b154b44435 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:51:37 +0000 Subject: [PATCH 10/13] Bump the k8s-core group with 2 updates (#270) Bumps the k8s-core group with 2 updates: [k8s.io/api](https://github.com/kubernetes/api) and [k8s.io/client-go](https://github.com/kubernetes/client-go). Updates `k8s.io/api` from 0.28.4 to 0.28.5 - [Commits](https://github.com/kubernetes/api/compare/v0.28.4...v0.28.5) Updates `k8s.io/client-go` from 0.28.4 to 0.28.5 - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes/client-go/compare/v0.28.4...v0.28.5) --- updated-dependencies: - dependency-name: k8s.io/api dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s-core - dependency-name: k8s.io/client-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s-core ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index a88f20d0..5224387e 100644 --- a/go.mod +++ b/go.mod @@ -18,9 +18,9 @@ require ( google.golang.org/api v0.154.0 google.golang.org/grpc v1.60.0 google.golang.org/protobuf v1.31.0 - k8s.io/api v0.28.4 - k8s.io/apimachinery v0.28.4 - k8s.io/client-go v0.28.4 + k8s.io/api v0.28.5 + k8s.io/apimachinery v0.28.5 + k8s.io/client-go v0.28.5 sigs.k8s.io/controller-runtime v0.16.3 sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20230513180526-af986b86bcca sigs.k8s.io/controller-tools v0.11.4 diff --git a/go.sum b/go.sum index fd7ea923..ff8dd0bf 100644 --- a/go.sum +++ b/go.sum @@ -1269,18 +1269,18 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.4.6 h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8= honnef.co/go/tools v0.4.6/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= -k8s.io/api v0.28.4 h1:8ZBrLjwosLl/NYgv1P7EQLqoO8MGQApnbgH8tu3BMzY= -k8s.io/api v0.28.4/go.mod h1:axWTGrY88s/5YE+JSt4uUi6NMM+gur1en2REMR7IRj0= +k8s.io/api v0.28.5 h1:XIPNr3nBgTEaCdEiwZ+dXaO9SB4NeTOZ2pNDRrFgfb4= +k8s.io/api v0.28.5/go.mod h1:98zkTCc60iSnqqCIyCB1GI7PYDiRDYTSfL0PRIxpM4c= k8s.io/apiextensions-apiserver v0.28.3 h1:Od7DEnhXHnHPZG+W9I97/fSQkVpVPQx2diy+2EtmY08= k8s.io/apiextensions-apiserver v0.28.3/go.mod h1:NE1XJZ4On0hS11aWWJUTNkmVB03j9LM7gJSisbRt8Lc= -k8s.io/apimachinery v0.28.4 h1:zOSJe1mc+GxuMnFzD4Z/U1wst50X28ZNsn5bhgIIao8= -k8s.io/apimachinery v0.28.4/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= +k8s.io/apimachinery v0.28.5 h1:EEj2q1qdTcv2p5wl88KavAn3VlFRjREgRu8Sm/EuMPY= +k8s.io/apimachinery v0.28.5/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= k8s.io/apiserver v0.28.3 h1:8Ov47O1cMyeDzTXz0rwcfIIGAP/dP7L8rWbEljRcg5w= k8s.io/apiserver v0.28.3/go.mod h1:YIpM+9wngNAv8Ctt0rHG4vQuX/I5rvkEMtZtsxW2rNM= k8s.io/cli-runtime v0.26.0 h1:aQHa1SyUhpqxAw1fY21x2z2OS5RLtMJOCj7tN4oq8mw= k8s.io/cli-runtime v0.26.0/go.mod h1:o+4KmwHzO/UK0wepE1qpRk6l3o60/txUZ1fEXWGIKTY= -k8s.io/client-go v0.28.4 h1:Np5ocjlZcTrkyRJ3+T3PkXDpe4UpatQxj85+xjaD2wY= -k8s.io/client-go v0.28.4/go.mod h1:0VDZFpgoZfelyP5Wqu0/r/TRYcLYuJ2U1KEeoaPa1N4= +k8s.io/client-go v0.28.5 h1:6UNmc33vuJhh3+SAOEKku3QnKa+DtPKGnhO2MR0IEbk= +k8s.io/client-go v0.28.5/go.mod h1:+pt086yx1i0HAlHzM9S+RZQDqdlzuXFl4hY01uhpcpA= k8s.io/component-base v0.28.3 h1:rDy68eHKxq/80RiMb2Ld/tbH8uAE75JdCqJyi6lXMzI= k8s.io/component-base v0.28.3/go.mod h1:fDJ6vpVNSk6cRo5wmDa6eKIG7UlIQkaFmZN2fYgIUD8= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= From d2eaf2115795179e4a44f47ec8809e868236bd06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:56:58 +0000 Subject: [PATCH 11/13] Bump google.golang.org/grpc from 1.60.0 to 1.60.1 (#274) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.60.0 to 1.60.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.60.0...v1.60.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5224387e..239a6c9f 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/prometheus/client_model v0.5.0 github.com/stretchr/testify v1.8.4 google.golang.org/api v0.154.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 google.golang.org/protobuf v1.31.0 k8s.io/api v0.28.5 k8s.io/apimachinery v0.28.5 diff --git a/go.sum b/go.sum index ff8dd0bf..f7cf2762 100644 --- a/go.sum +++ b/go.sum @@ -1215,8 +1215,8 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 3324da79964c3bba0324b6a67ff558b2db3c2f52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 09:01:58 +0000 Subject: [PATCH 12/13] Bump github.com/go-logr/logr from 1.3.0 to 1.4.1 (#272) Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 1.3.0 to 1.4.1. - [Release notes](https://github.com/go-logr/logr/releases) - [Changelog](https://github.com/go-logr/logr/blob/master/CHANGELOG.md) - [Commits](https://github.com/go-logr/logr/compare/v1.3.0...v1.4.1) --- updated-dependencies: - dependency-name: github.com/go-logr/logr dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 239a6c9f..4f061a87 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( cloud.google.com/go/pubsub v1.33.0 - github.com/go-logr/logr v1.3.0 + github.com/go-logr/logr v1.4.1 github.com/golangci/golangci-lint v1.55.2 github.com/google/uuid v1.5.0 github.com/jarcoal/httpmock v1.3.1 diff --git a/go.sum b/go.sum index f7cf2762..a7c0bd42 100644 --- a/go.sum +++ b/go.sum @@ -248,8 +248,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= From 0c304361c335143ea9dfd47f35e42c735b638cd8 Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Thu, 28 Dec 2023 22:46:46 +0100 Subject: [PATCH 13/13] Test hardning for lower case token types in Unleash (#263) --- controllers/apitoken_controller_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/apitoken_controller_test.go b/controllers/apitoken_controller_test.go index 553376bb..3f8348e8 100644 --- a/controllers/apitoken_controller_test.go +++ b/controllers/apitoken_controller_test.go @@ -77,7 +77,7 @@ var _ = Describe("ApiToken controller", func() { existingTokens.Tokens = append(existingTokens.Tokens, unleashclient.ApiToken{ Secret: ApiTokenSecret, Username: tokenRequest.Username, - Type: tokenRequest.Type, + Type: strings.ToLower(tokenRequest.Type), Environment: tokenRequest.Environment, Project: tokenRequest.Projects[0], Projects: tokenRequest.Projects, @@ -213,7 +213,7 @@ var _ = Describe("ApiToken controller", func() { Expect(httpmock.GetCallCountInfo()[fmt.Sprintf("POST %s", unleashclient.ApiTokensEndpoint)]).Should(Equal(1)) Expect(existingTokens.Tokens).Should(HaveLen(1)) Expect(existingTokens.Tokens[0].Username).Should(Equal(apiTokenCreated.ApiTokenName("unleasherator"))) - Expect(existingTokens.Tokens[0].Type).Should(Equal("CLIENT")) + Expect(existingTokens.Tokens[0].Type).Should(Equal("client")) Expect(existingTokens.Tokens[0].Environment).Should(Equal("development")) Expect(existingTokens.Tokens[0].Projects).Should(Equal([]string{"default"})) @@ -268,7 +268,7 @@ var _ = Describe("ApiToken controller", func() { Expect(httpmock.GetCallCountInfo()[fmt.Sprintf("POST %s", unleashclient.ApiTokensEndpoint)]).Should(Equal(1)) Expect(existingTokens.Tokens).Should(HaveLen(1)) - Expect(existingTokens.Tokens[0].Type).Should(Equal("FRONTEND")) + Expect(existingTokens.Tokens[0].Type).Should(Equal("frontend")) Expect(existingTokens.Tokens[0].Environment).Should(Equal("production")) Expect(existingTokens.Tokens[0].Projects).Should(Equal([]string{"project1", "project2", "project3"}))