From 23446a1bb6263cc230f1c87688982bea0ad9995a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:52:36 +0000 Subject: [PATCH 1/4] automation(deps): bump xmidt-org/shared-go from 4.4.14 to 4.4.15 (#761) Bumps [xmidt-org/shared-go](https://github.com/xmidt-org/shared-go) from 4.4.14 to 4.4.15. - [Release notes](https://github.com/xmidt-org/shared-go/releases) - [Commits](https://github.com/xmidt-org/shared-go/compare/c36ac2ad09d830fd07a1994264400c8c50e10302...9e2d208b64ea33fec7f0eb5adb0474ae4e5a639b) --- updated-dependencies: - dependency-name: xmidt-org/shared-go 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> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3e13536..04b9d81f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ on: jobs: ci: - uses: xmidt-org/shared-go/.github/workflows/ci.yml@c36ac2ad09d830fd07a1994264400c8c50e10302 # v4.4.14 + uses: xmidt-org/shared-go/.github/workflows/ci.yml@9e2d208b64ea33fec7f0eb5adb0474ae4e5a639b # v4.4.15 with: release-type: program release-docker: true From 00bbe5546c97ff0b86e7c249c01bb005ef4dca56 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:02:22 +0000 Subject: [PATCH 2/4] automation(deps): bump xmidt-org/shared-go from 4.4.15 to 4.4.16 (#763) Bumps [xmidt-org/shared-go](https://github.com/xmidt-org/shared-go) from 4.4.15 to 4.4.16. - [Release notes](https://github.com/xmidt-org/shared-go/releases) - [Commits](https://github.com/xmidt-org/shared-go/compare/9e2d208b64ea33fec7f0eb5adb0474ae4e5a639b...2cfcfbb8d0b4d0749d46488ea4c60ef998e566bd) --- updated-dependencies: - dependency-name: xmidt-org/shared-go 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> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04b9d81f..41597554 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ on: jobs: ci: - uses: xmidt-org/shared-go/.github/workflows/ci.yml@9e2d208b64ea33fec7f0eb5adb0474ae4e5a639b # v4.4.15 + uses: xmidt-org/shared-go/.github/workflows/ci.yml@2cfcfbb8d0b4d0749d46488ea4c60ef998e566bd # v4.4.16 with: release-type: program release-docker: true From ccf4136ee5609e49b770611eb2a1fed058e96e3f Mon Sep 17 00:00:00 2001 From: maura fortino Date: Wed, 17 Jul 2024 09:37:30 -0400 Subject: [PATCH 3/4] deleted model and chrysom folders from argus --- auth/provide.go | 4 +- chrysom/README.md | 21 - chrysom/basicClient.go | 275 ------------ chrysom/basicClient_test.go | 612 --------------------------- chrysom/doc.go | 5 - chrysom/listenerClient.go | 183 -------- chrysom/listenerClient_test.go | 203 --------- chrysom/metrics.go | 44 -- chrysom/pushResult.go | 28 -- chrysom/store.go | 47 -- go.mod | 16 +- go.sum | 27 +- model/model.go | 29 -- store/cassandra/db.go | 2 +- store/cassandra/executer.go | 2 +- store/dynamodb/db.go | 2 +- store/dynamodb/db_test.go | 2 +- store/dynamodb/instrumenting.go | 2 +- store/dynamodb/instrumenting_test.go | 2 +- store/dynamodb/mocks_test.go | 2 +- store/dynamodb/service.go | 2 +- store/dynamodb/service_test.go | 2 +- store/endpoint_test.go | 2 +- store/errors.go | 2 +- store/handler.go | 2 +- store/inmem/InMem.go | 2 +- store/inmem/InMem_test.go | 2 +- store/inputValidation.go | 2 +- store/mocks_test.go | 2 +- store/store.go | 2 +- store/test/mocks.go | 2 +- store/test/storetest.go | 2 +- store/transport.go | 2 +- store/transport_test.go | 2 +- 34 files changed, 44 insertions(+), 1492 deletions(-) delete mode 100644 chrysom/README.md delete mode 100644 chrysom/basicClient.go delete mode 100644 chrysom/basicClient_test.go delete mode 100644 chrysom/doc.go delete mode 100644 chrysom/listenerClient.go delete mode 100644 chrysom/listenerClient_test.go delete mode 100644 chrysom/metrics.go delete mode 100644 chrysom/pushResult.go delete mode 100644 chrysom/store.go delete mode 100644 model/model.go diff --git a/auth/provide.go b/auth/provide.go index ca8c99e1..d8ec4b0a 100644 --- a/auth/provide.go +++ b/auth/provide.go @@ -4,8 +4,6 @@ package auth import ( - "fmt" - "github.com/xmidt-org/bascule/basculechecks" "github.com/xmidt-org/bascule/basculehttp" "go.uber.org/fx" @@ -28,7 +26,7 @@ func Provide(configKey string) fx.Option { ), basculehttp.ProvideBasicAuth(configKey), provideBearerTokenFactory(configKey), - basculechecks.ProvideRegexCapabilitiesValidator(fmt.Sprintf("%v.capabilities", configKey)), + basculechecks.ProvideRegexCapabilitiesValidator(), basculehttp.ProvideBearerValidator(), basculehttp.ProvideServerChain(), ) diff --git a/chrysom/README.md b/chrysom/README.md deleted file mode 100644 index 83f6cec0..00000000 --- a/chrysom/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# chrysom -The client library for communicating with Argus over HTTP. - -[![Go Reference](https://pkg.go.dev/badge/github.com/xmidt-org/argus/chrysom.svg)](https://pkg.go.dev/github.com/xmidt-org/argus/chrysom) - -## Summary -This package enables CRUD operations on the items stored in Argus. The items being stored are valid JSON objects. The package also provides a listener that is able to poll from Argus on an interval. - -## CRUD Operations - -- On a `GetItems()` call, chrysom returns a list of all items belonging to the provided owner. -- `PushItem()` updates an item if the item exists and the ownership matches. If the item does not exist then a new item will be created. It will return an error or a string saying whether the item was successfully created or updated. -- `RemoveItem()` removes the item if it exists and returns the data associated to it. - -## Listener -The client contains a listener that will listen for item updates from Argus on an interval based on the client configuration. - -Listener provides a mechanism to fetch a copy of all items within a bucket on an interval. If not provided, listening won't be enable for this client. - -- Start begins listening for updates on an interval. A Listener must be given in the ListenerConfig for this to work. If a listener process is already in progress, calling Start() is a NoOp. If you want to restart the current listener process, call Stop() first. -- Stop requests the current listener process to stop and waits for its goroutine to complete. Calling Stop() when a listener is not running (or while one is getting stopped) returns an error. \ No newline at end of file diff --git a/chrysom/basicClient.go b/chrysom/basicClient.go deleted file mode 100644 index f80d0459..00000000 --- a/chrysom/basicClient.go +++ /dev/null @@ -1,275 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC -// SPDX-License-Identifier: Apache-2.0 - -package chrysom - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - - "github.com/xmidt-org/argus/model" - "github.com/xmidt-org/argus/store" - "github.com/xmidt-org/bascule/acquire" - "go.uber.org/zap" -) - -var ( - ErrNilMeasures = errors.New("measures cannot be nil") - ErrAddressEmpty = errors.New("argus address is required") - ErrBucketEmpty = errors.New("bucket name is required") - ErrItemIDEmpty = errors.New("item ID is required") - ErrItemDataEmpty = errors.New("data field in item is required") - ErrUndefinedIntervalTicker = errors.New("interval ticker is nil. Can't listen for updates") - ErrAuthAcquirerFailure = errors.New("failed acquiring auth token") - ErrBadRequest = errors.New("argus rejected the request as invalid") -) - -var ( - errNonSuccessResponse = errors.New("argus responded with a non-success status code") - errNewRequestFailure = errors.New("failed creating an HTTP request") - errDoRequestFailure = errors.New("http client failed while sending request") - errReadingBodyFailure = errors.New("failed while reading http response body") - errJSONUnmarshal = errors.New("failed unmarshaling JSON response payload") - errJSONMarshal = errors.New("failed marshaling item as JSON payload") -) - -// BasicClientConfig contains config data for the client that will be used to -// make requests to the Argus client. -type BasicClientConfig struct { - // Address is the Argus URL (i.e. https://example-argus.io:8090) - Address string - - // Bucket partition to be used by this client. - Bucket string - - // HTTPClient refers to the client that will be used to send requests. - // (Optional) Defaults to http.DefaultClient. - HTTPClient *http.Client - - // Auth provides the mechanism to add auth headers to outgoing requests. - // (Optional) If not provided, no auth headers are added. - Auth Auth -} - -// BasicClient is the client used to make requests to Argus. -type BasicClient struct { - client *http.Client - auth acquire.Acquirer - storeBaseURL string - bucket string - getLogger func(context.Context) *zap.Logger -} - -// Auth contains authorization data for requests to Argus. -type Auth struct { - JWT acquire.RemoteBearerTokenAcquirerOptions - Basic string -} - -type response struct { - Body []byte - ArgusErrorHeader string - Code int -} - -const ( - storeAPIPath = "/api/v1/store" - errWrappedFmt = "%w: %s" - errStatusCodeFmt = "%w: received status %v" - errorHeaderKey = "errorHeader" -) - -// Items is a slice of model.Item(s) . -type Items []model.Item - -// NewBasicClient creates a new BasicClient that can be used to -// make requests to Argus. -func NewBasicClient(config BasicClientConfig, - getLogger func(context.Context) *zap.Logger) (*BasicClient, error) { - err := validateBasicConfig(&config) - if err != nil { - return nil, err - } - - tokenAcquirer, err := buildTokenAcquirer(config.Auth) - if err != nil { - return nil, err - } - clientStore := &BasicClient{ - client: config.HTTPClient, - auth: tokenAcquirer, - bucket: config.Bucket, - storeBaseURL: config.Address + storeAPIPath, - getLogger: getLogger, - } - - return clientStore, nil -} - -// GetItems fetches all items that belong to a given owner. -func (c *BasicClient) GetItems(ctx context.Context, owner string) (Items, error) { - response, err := c.sendRequest(ctx, owner, http.MethodGet, fmt.Sprintf("%s/%s", c.storeBaseURL, c.bucket), nil) - if err != nil { - return nil, err - } - - if response.Code != http.StatusOK { - c.getLogger(ctx).Error("Argus responded with non-200 response for GetItems request", - zap.Int("code", response.Code), zap.String(errorHeaderKey, response.ArgusErrorHeader)) - return nil, fmt.Errorf(errStatusCodeFmt, translateNonSuccessStatusCode(response.Code), response.Code) - } - - var items Items - - err = json.Unmarshal(response.Body, &items) - if err != nil { - return nil, fmt.Errorf("GetItems: %w: %s", errJSONUnmarshal, err.Error()) - } - - return items, nil -} - -// PushItem creates a new item if one doesn't already exist. If an item exists -// and the ownership matches, the item is simply updated. -func (c *BasicClient) PushItem(ctx context.Context, owner string, item model.Item) (PushResult, error) { - err := validatePushItemInput(owner, item) - if err != nil { - return NilPushResult, err - } - - data, err := json.Marshal(item) - if err != nil { - return NilPushResult, fmt.Errorf(errWrappedFmt, errJSONMarshal, err.Error()) - } - - response, err := c.sendRequest(ctx, owner, http.MethodPut, fmt.Sprintf("%s/%s/%s", c.storeBaseURL, c.bucket, item.ID), bytes.NewReader(data)) - if err != nil { - return NilPushResult, err - } - - if response.Code == http.StatusCreated { - return CreatedPushResult, nil - } - - if response.Code == http.StatusOK { - return UpdatedPushResult, nil - } - - c.getLogger(ctx).Error("Argus responded with a non-successful status code for a PushItem request", - zap.Int("code", response.Code), zap.String(errorHeaderKey, response.ArgusErrorHeader)) - - return NilPushResult, fmt.Errorf(errStatusCodeFmt, translateNonSuccessStatusCode(response.Code), response.Code) -} - -// RemoveItem removes the item if it exists and returns the data associated to it. -func (c *BasicClient) RemoveItem(ctx context.Context, id, owner string) (model.Item, error) { - if len(id) < 1 { - return model.Item{}, ErrItemIDEmpty - } - - resp, err := c.sendRequest(ctx, owner, http.MethodDelete, fmt.Sprintf("%s/%s/%s", c.storeBaseURL, c.bucket, id), nil) - if err != nil { - return model.Item{}, err - } - - if resp.Code != http.StatusOK { - c.getLogger(ctx).Error("Argus responded with a non-successful status code for a RemoveItem request", - zap.Int("code", resp.Code), zap.String(errorHeaderKey, resp.ArgusErrorHeader)) - return model.Item{}, fmt.Errorf(errStatusCodeFmt, translateNonSuccessStatusCode(resp.Code), resp.Code) - } - - var item model.Item - err = json.Unmarshal(resp.Body, &item) - if err != nil { - return item, fmt.Errorf("RemoveItem: %w: %s", errJSONUnmarshal, err.Error()) - } - return item, nil -} - -func validatePushItemInput(owner string, item model.Item) error { - if len(item.ID) < 1 { - return ErrItemIDEmpty - } - - if len(item.Data) < 1 { - return ErrItemDataEmpty - } - - return nil -} - -func (c *BasicClient) sendRequest(ctx context.Context, owner, method, url string, body io.Reader) (response, error) { - r, err := http.NewRequestWithContext(ctx, method, url, body) - if err != nil { - return response{}, fmt.Errorf(errWrappedFmt, errNewRequestFailure, err.Error()) - } - err = acquire.AddAuth(r, c.auth) - if err != nil { - return response{}, fmt.Errorf(errWrappedFmt, ErrAuthAcquirerFailure, err.Error()) - } - if len(owner) > 0 { - r.Header.Set(store.ItemOwnerHeaderKey, owner) - } - resp, err := c.client.Do(r) - if err != nil { - return response{}, fmt.Errorf(errWrappedFmt, errDoRequestFailure, err.Error()) - } - defer resp.Body.Close() - var sqResp = response{ - Code: resp.StatusCode, - ArgusErrorHeader: resp.Header.Get(store.XmidtErrorHeaderKey), - } - bodyBytes, err := io.ReadAll(resp.Body) - if err != nil { - return sqResp, fmt.Errorf(errWrappedFmt, errReadingBodyFailure, err.Error()) - } - sqResp.Body = bodyBytes - return sqResp, nil -} - -func isEmpty(options acquire.RemoteBearerTokenAcquirerOptions) bool { - return len(options.AuthURL) < 1 || options.Buffer == 0 || options.Timeout == 0 -} - -// translateNonSuccessStatusCode returns as specific error -// for known Argus status codes. -func translateNonSuccessStatusCode(code int) error { - switch code { - case http.StatusBadRequest: - return ErrBadRequest - case http.StatusUnauthorized, http.StatusForbidden: - return ErrFailedAuthentication - default: - return errNonSuccessResponse - } -} - -func buildTokenAcquirer(auth Auth) (acquire.Acquirer, error) { - if !isEmpty(auth.JWT) { - return acquire.NewRemoteBearerTokenAcquirer(auth.JWT) - } else if len(auth.Basic) > 0 { - return acquire.NewFixedAuthAcquirer(auth.Basic) - } - return &acquire.DefaultAcquirer{}, nil -} - -func validateBasicConfig(config *BasicClientConfig) error { - if config.Address == "" { - return ErrAddressEmpty - } - - if config.Bucket == "" { - return ErrBucketEmpty - } - - if config.HTTPClient == nil { - config.HTTPClient = http.DefaultClient - } - - return nil -} diff --git a/chrysom/basicClient_test.go b/chrysom/basicClient_test.go deleted file mode 100644 index 3a5cd36f..00000000 --- a/chrysom/basicClient_test.go +++ /dev/null @@ -1,612 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC -// SPDX-License-Identifier: Apache-2.0 - -package chrysom - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "net/http/httptest" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/argus/model" - "github.com/xmidt-org/argus/store" - "github.com/xmidt-org/sallust" -) - -const failingURL = "nowhere://" - -var ( - _ Pusher = &BasicClient{} - _ Reader = &BasicClient{} -) - -func TestValidateBasicConfig(t *testing.T) { - type testCase struct { - Description string - Input *BasicClientConfig - ExpectedErr error - ExpectedConfig *BasicClientConfig - } - - allDefaultsCaseConfig := &BasicClientConfig{ - HTTPClient: http.DefaultClient, - Address: "http://awesome-argus-hostname.io", - Bucket: "bucket-name", - } - myAmazingClient := &http.Client{Timeout: time.Hour} - allDefinedCaseConfig := &BasicClientConfig{ - HTTPClient: myAmazingClient, - Address: "http://legit-argus-hostname.io", - Auth: Auth{}, - Bucket: "amazing-bucket", - } - - tcs := []testCase{ - { - Description: "No address", - Input: &BasicClientConfig{ - Bucket: "bucket-name", - }, - ExpectedErr: ErrAddressEmpty, - }, - { - Description: "No bucket", - Input: &BasicClientConfig{ - Address: "http://awesome-argus-hostname.io", - }, - ExpectedErr: ErrBucketEmpty, - }, - { - Description: "All default values", - Input: &BasicClientConfig{ - Address: "http://awesome-argus-hostname.io", - Bucket: "bucket-name", - }, - ExpectedConfig: allDefaultsCaseConfig, - }, - { - Description: "All defined", - Input: &BasicClientConfig{ - Address: "http://legit-argus-hostname.io", - Bucket: "amazing-bucket", - HTTPClient: myAmazingClient, - }, - ExpectedConfig: allDefinedCaseConfig, - }, - } - - for _, tc := range tcs { - t.Run(tc.Description, func(t *testing.T) { - assert := assert.New(t) - err := validateBasicConfig(tc.Input) - assert.Equal(tc.ExpectedErr, err) - if tc.ExpectedErr == nil { - assert.Equal(tc.ExpectedConfig, tc.Input) - } - }) - } -} - -func TestSendRequest(t *testing.T) { - type testCase struct { - Description string - Owner string - Method string - URL string - Body []byte - AcquirerFails bool - ClientDoFails bool - ExpectedResponse response - ExpectedErr error - } - - tcs := []testCase{ - { - Description: "New Request fails", - Method: "what method?", - URL: "http://argus-hostname.io", - ExpectedErr: errNewRequestFailure, - }, - { - Description: "Auth acquirer fails", - Method: http.MethodGet, - URL: "http://argus-hostname.io", - AcquirerFails: true, - ExpectedErr: ErrAuthAcquirerFailure, - }, - { - Description: "Client Do fails", - Method: http.MethodPut, - ClientDoFails: true, - ExpectedErr: errDoRequestFailure, - }, - { - Description: "Happy path", - Method: http.MethodPut, - URL: "http://argus-hostname.io", - Body: []byte("testing"), - Owner: "HappyCaseOwner", - ExpectedResponse: response{ - Code: http.StatusOK, - Body: []byte("testing"), - }, - }, - } - for _, tc := range tcs { - t.Run(tc.Description, func(t *testing.T) { - assert := assert.New(t) - require := require.New(t) - - echoHandler := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - assert.Equal(tc.Owner, r.Header.Get(store.ItemOwnerHeaderKey)) - rw.WriteHeader(http.StatusOK) - bodyBytes, err := io.ReadAll(r.Body) - require.Nil(err) - rw.Write(bodyBytes) - }) - - server := httptest.NewServer(echoHandler) - defer server.Close() - - client, err := NewBasicClient(BasicClientConfig{ - HTTPClient: server.Client(), - Address: "http://argus-hostname.io", - Bucket: "bucket-name", - }, sallust.Get) - - if tc.AcquirerFails { - client.auth = acquirerFunc(failAcquirer) - } - - var URL = server.URL - if tc.ClientDoFails { - URL = "http://should-definitely-fail.net" - } - - assert.Nil(err) - resp, err := client.sendRequest(context.TODO(), tc.Owner, tc.Method, URL, bytes.NewBuffer(tc.Body)) - - if tc.ExpectedErr == nil { - assert.Equal(http.StatusOK, resp.Code) - assert.Equal(tc.ExpectedResponse, resp) - } else { - assert.True(errors.Is(err, tc.ExpectedErr)) - } - }) - } -} - -func TestGetItems(t *testing.T) { - type testCase struct { - Description string - ResponsePayload []byte - ResponseCode int - ShouldMakeRequestFail bool - ShouldDoRequestFail bool - ExpectedErr error - ExpectedOutput Items - } - - tcs := []testCase{ - { - - Description: "Make request fails", - ShouldMakeRequestFail: true, - ExpectedErr: ErrAuthAcquirerFailure, - }, - { - Description: "Do request fails", - ShouldDoRequestFail: true, - ExpectedErr: errDoRequestFailure, - }, - { - Description: "Unauthorized", - ResponseCode: http.StatusForbidden, - ExpectedErr: ErrFailedAuthentication, - }, - { - Description: "Bad request", - ResponseCode: http.StatusBadRequest, - ExpectedErr: ErrBadRequest, - }, - { - Description: "Other non-success", - ResponseCode: http.StatusInternalServerError, - ExpectedErr: errNonSuccessResponse, - }, - { - Description: "Payload unmarshal error", - ResponseCode: http.StatusOK, - ResponsePayload: []byte("[{}"), - ExpectedErr: errJSONUnmarshal, - }, - { - Description: "Happy path", - ResponseCode: http.StatusOK, - ResponsePayload: getItemsValidPayload(), - ExpectedOutput: getItemsHappyOutput(), - }, - } - - for _, tc := range tcs { - t.Run(tc.Description, func(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - bucket = "bucket-name" - owner = "owner-name" - ) - - server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - assert.Equal(http.MethodGet, r.Method) - assert.Equal(owner, r.Header.Get(store.ItemOwnerHeaderKey)) - assert.Equal(fmt.Sprintf("%s/%s", storeAPIPath, bucket), r.URL.Path) - - rw.WriteHeader(tc.ResponseCode) - rw.Write(tc.ResponsePayload) - })) - - client, err := NewBasicClient(BasicClientConfig{ - HTTPClient: server.Client(), - Address: server.URL, - Bucket: bucket, - }, sallust.Get) - - require.Nil(err) - - if tc.ShouldMakeRequestFail { - client.auth = acquirerFunc(failAcquirer) - } - - if tc.ShouldDoRequestFail { - client.storeBaseURL = failingURL - } - - output, err := client.GetItems(context.TODO(), owner) - - assert.True(errors.Is(err, tc.ExpectedErr)) - if tc.ExpectedErr == nil { - assert.EqualValues(tc.ExpectedOutput, output) - } - }) - } -} - -func TestPushItem(t *testing.T) { - type testCase struct { - Description string - Item model.Item - Owner string - ResponseCode int - ShouldEraseBucket bool - ShouldRespNonSuccess bool - ShouldMakeRequestFail bool - ShouldDoRequestFail bool - ExpectedErr error - ExpectedOutput PushResult - } - - validItem := model.Item{ - ID: "252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111", - Data: map[string]interface{}{ - "field0": float64(0), - "nested": map[string]interface{}{ - "response": "wow", - }, - }} - - tcs := []testCase{ - { - Description: "Item ID Missing", - Item: model.Item{Data: map[string]interface{}{}}, - ExpectedErr: ErrItemIDEmpty, - }, - { - Description: "Item Data missing", - Item: model.Item{ID: validItem.ID}, - ExpectedErr: ErrItemDataEmpty, - }, - { - Description: "Make request fails", - Item: validItem, - ShouldMakeRequestFail: true, - ExpectedErr: ErrAuthAcquirerFailure, - }, - { - Description: "Do request fails", - Item: validItem, - ShouldDoRequestFail: true, - ExpectedErr: errDoRequestFailure, - }, - { - Description: "Unauthorized", - Item: validItem, - ResponseCode: http.StatusForbidden, - ExpectedErr: ErrFailedAuthentication, - }, - { - Description: "Bad request", - Item: validItem, - ResponseCode: http.StatusBadRequest, - ExpectedErr: ErrBadRequest, - }, - { - Description: "Other non-success", - Item: validItem, - ResponseCode: http.StatusInternalServerError, - ExpectedErr: errNonSuccessResponse, - }, - { - Description: "Create success", - Item: validItem, - ResponseCode: http.StatusCreated, - ExpectedOutput: CreatedPushResult, - }, - { - Description: "Update success", - Item: validItem, - ResponseCode: http.StatusOK, - ExpectedOutput: UpdatedPushResult, - }, - { - Description: "Update success with owner", - Item: validItem, - ResponseCode: http.StatusOK, - Owner: "owner-name", - ExpectedOutput: UpdatedPushResult, - }, - } - - for _, tc := range tcs { - t.Run(tc.Description, func(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - bucket = "bucket-name" - id = "252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111" - ) - - server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - assert.Equal(fmt.Sprintf("%s/%s/%s", storeAPIPath, bucket, id), r.URL.Path) - assert.Equal(tc.Owner, r.Header.Get(store.ItemOwnerHeaderKey)) - rw.WriteHeader(tc.ResponseCode) - - if tc.ResponseCode == http.StatusCreated || tc.ResponseCode == http.StatusOK { - payload, err := io.ReadAll(r.Body) - require.Nil(err) - var item model.Item - err = json.Unmarshal(payload, &item) - require.Nil(err) - assert.EqualValues(tc.Item, item) - } - })) - - client, err := NewBasicClient(BasicClientConfig{ - HTTPClient: server.Client(), - Address: server.URL, - Bucket: bucket, - }, sallust.Get) - - if tc.ShouldMakeRequestFail { - client.auth = acquirerFunc(failAcquirer) - } - - if tc.ShouldDoRequestFail { - client.storeBaseURL = failingURL - } - - if tc.ShouldEraseBucket { - bucket = "" - } - - require.Nil(err) - output, err := client.PushItem(context.TODO(), tc.Owner, tc.Item) - - if tc.ExpectedErr == nil { - assert.EqualValues(tc.ExpectedOutput, output) - } else { - assert.True(errors.Is(err, tc.ExpectedErr)) - } - }) - } -} - -func TestRemoveItem(t *testing.T) { - type testCase struct { - Description string - ResponsePayload []byte - ResponseCode int - Owner string - ShouldRespNonSuccess bool - ShouldMakeRequestFail bool - ShouldDoRequestFail bool - ExpectedErr error - ExpectedOutput model.Item - } - - tcs := []testCase{ - { - Description: "Make request fails", - ShouldMakeRequestFail: true, - ExpectedErr: ErrAuthAcquirerFailure, - }, - { - Description: "Do request fails", - ShouldDoRequestFail: true, - ExpectedErr: errDoRequestFailure, - }, - { - Description: "Unauthorized", - ResponseCode: http.StatusForbidden, - ExpectedErr: ErrFailedAuthentication, - }, - { - Description: "Bad request", - ResponseCode: http.StatusBadRequest, - ExpectedErr: ErrBadRequest, - }, - { - Description: "Other non-success", - ResponseCode: http.StatusInternalServerError, - ExpectedErr: errNonSuccessResponse, - }, - { - Description: "Unmarshal failure", - ResponseCode: http.StatusOK, - ResponsePayload: []byte("{{}"), - ExpectedErr: errJSONUnmarshal, - }, - { - Description: "Succcess", - ResponseCode: http.StatusOK, - ResponsePayload: getRemoveItemValidPayload(), - ExpectedOutput: getRemoveItemHappyOutput(), - }, - } - - for _, tc := range tcs { - t.Run(tc.Description, func(t *testing.T) { - var ( - assert = assert.New(t) - require = require.New(t) - bucket = "bucket-name" - // nolint:gosec - id = "7e8c5f378b4addbaebc70897c4478cca06009e3e360208ebd073dbee4b3774e7" - ) - server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - assert.Equal(fmt.Sprintf("%s/%s/%s", storeAPIPath, bucket, id), r.URL.Path) - assert.Equal(http.MethodDelete, r.Method) - rw.WriteHeader(tc.ResponseCode) - rw.Write(tc.ResponsePayload) - })) - - client, err := NewBasicClient(BasicClientConfig{ - HTTPClient: server.Client(), - Address: server.URL, - Bucket: bucket, - }, sallust.Get) - - if tc.ShouldMakeRequestFail { - client.auth = acquirerFunc(failAcquirer) - } - - if tc.ShouldDoRequestFail { - client.storeBaseURL = failingURL - } - - require.Nil(err) - output, err := client.RemoveItem(context.TODO(), id, tc.Owner) - - if tc.ExpectedErr == nil { - assert.EqualValues(tc.ExpectedOutput, output) - } else { - assert.True(errors.Is(err, tc.ExpectedErr)) - } - }) - } -} - -func TestTranslateStatusCode(t *testing.T) { - type testCase struct { - Description string - Code int - ExpectedErr error - } - - tcs := []testCase{ - { - Code: http.StatusForbidden, - ExpectedErr: ErrFailedAuthentication, - }, - { - Code: http.StatusUnauthorized, - ExpectedErr: ErrFailedAuthentication, - }, - { - Code: http.StatusBadRequest, - ExpectedErr: ErrBadRequest, - }, - { - Code: http.StatusInternalServerError, - ExpectedErr: errNonSuccessResponse, - }, - } - - for _, tc := range tcs { - t.Run(tc.Description, func(t *testing.T) { - assert := assert.New(t) - assert.Equal(tc.ExpectedErr, translateNonSuccessStatusCode(tc.Code)) - }) - } -} - -func failAcquirer() (string, error) { - return "", errors.New("always fail") -} - -type acquirerFunc func() (string, error) - -func (a acquirerFunc) Acquire() (string, error) { - return a() -} - -func getRemoveItemValidPayload() []byte { - return []byte(` - { - "id": "7e8c5f378b4addbaebc70897c4478cca06009e3e360208ebd073dbee4b3774e7", - "data": { - "words": [ - "Hello","World" - ], - "year": 2021 - }, - "ttl": 100 - }`) -} - -func getRemoveItemHappyOutput() model.Item { - return model.Item{ - ID: "7e8c5f378b4addbaebc70897c4478cca06009e3e360208ebd073dbee4b3774e7", - Data: map[string]interface{}{ - "words": []interface{}{"Hello", "World"}, - "year": float64(2021), - }, - TTL: aws.Int64(100), - } -} - -func getItemsValidPayload() []byte { - return []byte(`[{ - "id": "7e8c5f378b4addbaebc70897c4478cca06009e3e360208ebd073dbee4b3774e7", - "data": { - "words": [ - "Hello","World" - ], - "year": 2021 - }, - "ttl": 255 - }]`) -} - -func getItemsHappyOutput() Items { - return []model.Item{ - { - ID: "7e8c5f378b4addbaebc70897c4478cca06009e3e360208ebd073dbee4b3774e7", - Data: map[string]interface{}{ - "words": []interface{}{"Hello", "World"}, - "year": float64(2021), - }, - TTL: aws.Int64(255), - }, - } -} diff --git a/chrysom/doc.go b/chrysom/doc.go deleted file mode 100644 index 8ad7f375..00000000 --- a/chrysom/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC -// SPDX-License-Identifier: Apache-2.0 - -// Package chrysom provides a client in order to interact with argus. -package chrysom diff --git a/chrysom/listenerClient.go b/chrysom/listenerClient.go deleted file mode 100644 index b02cbf67..00000000 --- a/chrysom/listenerClient.go +++ /dev/null @@ -1,183 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC -// SPDX-License-Identifier: Apache-2.0 - -package chrysom - -import ( - "context" - "errors" - "sync/atomic" - "time" - - "github.com/prometheus/client_golang/prometheus" - "github.com/xmidt-org/sallust" - "go.uber.org/zap" -) - -// Errors that can be returned by this package. Since some of these errors are returned wrapped, it -// is safest to use errors.Is() to check for them. -// Some internal errors might be unwrapped from output errors but unless these errors become exported, -// they are not part of the library API and may change in future versions. -var ( - ErrFailedAuthentication = errors.New("failed to authentication with argus") - - ErrListenerNotStopped = errors.New("listener is either running or starting") - ErrListenerNotRunning = errors.New("listener is either stopped or stopping") - ErrNoListenerProvided = errors.New("no listener provided") - ErrNoReaderProvided = errors.New("no reader provided") -) - -// listening states -const ( - stopped int32 = iota - running - transitioning -) - -const ( - defaultPullInterval = time.Second * 5 -) - -// ListenerConfig contains config data for polling the Argus client. -type ListenerClientConfig struct { - // Listener provides a mechanism to fetch a copy of all items within a bucket on - // an interval. - // (Optional). If not provided, listening won't be enabled for this client. - Listener Listener - - // PullInterval is how often listeners should get updates. - // (Optional). Defaults to 5 seconds. - PullInterval time.Duration - - // Logger to be used by the client. - // (Optional). By default a no op logger will be used. - Logger *zap.Logger -} - -// ListenerClient is the client used to poll Argus for updates. -type ListenerClient struct { - observer *observerConfig - logger *zap.Logger - setLogger func(context.Context, *zap.Logger) context.Context - reader Reader -} - -type observerConfig struct { - listener Listener - ticker *time.Ticker - pullInterval time.Duration - measures *Measures - shutdown chan struct{} - state int32 -} - -// NewListenerClient creates a new ListenerClient to be used to poll Argus -// for updates. -func NewListenerClient(config ListenerClientConfig, - setLogger func(context.Context, *zap.Logger) context.Context, - measures *Measures, r Reader, -) (*ListenerClient, error) { - err := validateListenerConfig(&config) - if err != nil { - return nil, err - } - if measures == nil { - return nil, ErrNilMeasures - } - if setLogger == nil { - setLogger = func(ctx context.Context, _ *zap.Logger) context.Context { - return ctx - } - } - if r == nil { - return nil, ErrNoReaderProvided - } - return &ListenerClient{ - observer: &observerConfig{ - listener: config.Listener, - ticker: time.NewTicker(config.PullInterval), - pullInterval: config.PullInterval, - measures: measures, - shutdown: make(chan struct{}), - }, - logger: config.Logger, - setLogger: setLogger, - reader: r, - }, nil -} - -// Start begins listening for updates on an interval given that client configuration -// is setup correctly. If a listener process is already in progress, calling Start() -// is a NoOp. If you want to restart the current listener process, call Stop() first. -func (c *ListenerClient) Start(ctx context.Context) error { - if c.observer == nil || c.observer.listener == nil { - c.logger.Warn("No listener was setup to receive updates.") - return nil - } - if c.observer.ticker == nil { - c.logger.Error("Observer ticker is nil", zap.Error(ErrUndefinedIntervalTicker)) - return ErrUndefinedIntervalTicker - } - - if !atomic.CompareAndSwapInt32(&c.observer.state, stopped, transitioning) { - c.logger.Error("Start called when a listener was not in stopped state", zap.Error(ErrListenerNotStopped)) - return ErrListenerNotStopped - } - - c.observer.ticker.Reset(c.observer.pullInterval) - go func() { - for { - select { - case <-c.observer.shutdown: - return - case <-c.observer.ticker.C: - outcome := SuccessOutcome - ctx := c.setLogger(context.Background(), c.logger) - items, err := c.reader.GetItems(ctx, "") - if err == nil { - c.observer.listener.Update(items) - } else { - outcome = FailureOutcome - c.logger.Error("Failed to get items for listeners", zap.Error(err)) - } - c.observer.measures.Polls.With(prometheus.Labels{ - OutcomeLabel: outcome}).Add(1) - } - } - }() - - atomic.SwapInt32(&c.observer.state, running) - return nil -} - -// Stop requests the current listener process to stop and waits for its goroutine to complete. -// Calling Stop() when a listener is not running (or while one is getting stopped) returns an -// error. -func (c *ListenerClient) Stop(ctx context.Context) error { - if c.observer == nil || c.observer.ticker == nil { - return nil - } - - if !atomic.CompareAndSwapInt32(&c.observer.state, running, transitioning) { - c.logger.Error("Stop called when a listener was not in running state", zap.Error(ErrListenerNotStopped)) - return ErrListenerNotRunning - } - - c.observer.ticker.Stop() - c.observer.shutdown <- struct{}{} - atomic.SwapInt32(&c.observer.state, stopped) - return nil -} - -func validateListenerConfig(config *ListenerClientConfig) error { - if config.Listener == nil { - return ErrNoListenerProvided - } - if config.Logger == nil { - config.Logger = sallust.Default() - } - if config.PullInterval == 0 { - config.PullInterval = defaultPullInterval - } - return nil -} diff --git a/chrysom/listenerClient_test.go b/chrysom/listenerClient_test.go deleted file mode 100644 index f469dc06..00000000 --- a/chrysom/listenerClient_test.go +++ /dev/null @@ -1,203 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC -// SPDX-License-Identifier: Apache-2.0 - -package chrysom - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/http/httptest" - "strconv" - "testing" - "time" - - "github.com/prometheus/client_golang/prometheus" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xmidt-org/sallust" -) - -var ( - mockListener = ListenerFunc((func(_ Items) { - fmt.Println("Doing amazing work for 100ms") - time.Sleep(time.Millisecond * 100) - })) - mockMeasures = &Measures{ - Polls: prometheus.NewCounterVec( - prometheus.CounterOpts{ - Name: "testPollsCounter", - Help: "testPollsCounter", - }, - []string{OutcomeLabel}, - )} - happyListenerClientConfig = ListenerClientConfig{ - Listener: mockListener, - PullInterval: time.Second, - Logger: sallust.Default(), - } -) - -func TestListenerStartStopPairsParallel(t *testing.T) { - require := require.New(t) - client, close, err := newStartStopClient(true) - assert.Nil(t, err) - defer close() - - t.Run("ParallelGroup", func(t *testing.T) { - for i := 0; i < 20; i++ { - testNumber := i - t.Run(strconv.Itoa(testNumber), func(t *testing.T) { - t.Parallel() - assert := assert.New(t) - fmt.Printf("%d: Start\n", testNumber) - errStart := client.Start(context.Background()) - if errStart != nil { - assert.Equal(ErrListenerNotStopped, errStart) - } - time.Sleep(time.Millisecond * 400) - errStop := client.Stop(context.Background()) - if errStop != nil { - assert.Equal(ErrListenerNotRunning, errStop) - } - fmt.Printf("%d: Done\n", testNumber) - }) - } - }) - - require.Equal(stopped, client.observer.state) -} - -func TestListenerStartStopPairsSerial(t *testing.T) { - require := require.New(t) - client, close, err := newStartStopClient(true) - assert.Nil(t, err) - defer close() - - for i := 0; i < 5; i++ { - testNumber := i - t.Run(strconv.Itoa(testNumber), func(t *testing.T) { - assert := assert.New(t) - fmt.Printf("%d: Start\n", testNumber) - assert.Nil(client.Start(context.Background())) - assert.Nil(client.Stop(context.Background())) - fmt.Printf("%d: Done\n", testNumber) - }) - } - require.Equal(stopped, client.observer.state) -} - -func TestListenerEdgeCases(t *testing.T) { - t.Run("NoListener", func(t *testing.T) { - _, _, err := newStartStopClient(false) - assert.Equal(t, ErrNoListenerProvided, err) - }) - - t.Run("NilTicker", func(t *testing.T) { - assert := assert.New(t) - client, stopServer, err := newStartStopClient(true) - assert.Nil(err) - defer stopServer() - client.observer.ticker = nil - assert.Equal(ErrUndefinedIntervalTicker, client.Start(context.Background())) - }) -} - -func newStartStopClient(includeListener bool) (*ListenerClient, func(), error) { - server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - rw.Write(getItemsValidPayload()) - })) - - config := ListenerClientConfig{ - PullInterval: time.Millisecond * 200, - Logger: sallust.Default(), - } - if includeListener { - config.Listener = mockListener - } - client, err := NewListenerClient(config, nil, mockMeasures, &BasicClient{}) - if err != nil { - return nil, nil, err - } - - return client, server.Close, nil -} - -func TestValidateListenerConfig(t *testing.T) { - tcs := []struct { - desc string - expectedErr error - config ListenerClientConfig - }{ - { - desc: "Happy case Success", - config: happyListenerClientConfig, - }, - { - desc: "No listener Failure", - config: ListenerClientConfig{}, - expectedErr: ErrNoListenerProvided, - }, - { - desc: "No logger and no pull interval Success", - config: ListenerClientConfig{ - Listener: mockListener, - }, - }, - } - for _, tc := range tcs { - t.Run(tc.desc, func(t *testing.T) { - assert := assert.New(t) - c := tc.config - err := validateListenerConfig(&c) - assert.True(errors.Is(err, tc.expectedErr), - fmt.Errorf("error [%v] doesn't contain error [%v] in its err chain", - err, tc.expectedErr), - ) - }) - } -} - -func TestNewListenerClient(t *testing.T) { - tcs := []struct { - desc string - config ListenerClientConfig - expectedErr error - measures *Measures - reader Reader - }{ - { - desc: "Listener Config Failure", - config: ListenerClientConfig{}, - expectedErr: ErrNoListenerProvided, - }, - { - desc: "No measures Failure", - config: happyListenerClientConfig, - expectedErr: ErrNilMeasures, - }, - { - desc: "No reader Failure", - config: happyListenerClientConfig, - measures: mockMeasures, - expectedErr: ErrNoReaderProvided, - }, - { - desc: "Happy case Success", - config: happyListenerClientConfig, - measures: mockMeasures, - reader: &BasicClient{}, - }, - } - for _, tc := range tcs { - t.Run(tc.desc, func(t *testing.T) { - assert := assert.New(t) - _, err := NewListenerClient(tc.config, nil, tc.measures, tc.reader) - assert.True(errors.Is(err, tc.expectedErr), - fmt.Errorf("error [%v] doesn't contain error [%v] in its err chain", - err, tc.expectedErr), - ) - }) - } -} diff --git a/chrysom/metrics.go b/chrysom/metrics.go deleted file mode 100644 index 14da104c..00000000 --- a/chrysom/metrics.go +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC -// SPDX-License-Identifier: Apache-2.0 - -package chrysom - -import ( - "github.com/prometheus/client_golang/prometheus" - "github.com/xmidt-org/touchstone" - "go.uber.org/fx" -) - -// Names -const ( - PollCounter = "chrysom_polls_total" -) - -// Labels -const ( - OutcomeLabel = "outcome" -) - -// Label Values -const ( - SuccessOutcome = "success" - FailureOutcome = "failure" -) - -// Metrics returns the Metrics relevant to this package -func ProvideMetrics() fx.Option { - return fx.Options( - touchstone.CounterVec( - prometheus.CounterOpts{ - Name: PollCounter, - Help: "Counter for the number of polls (and their success/failure outcomes) to fetch new items.", - }, - OutcomeLabel, - ), - ) -} - -type Measures struct { - fx.In - Polls *prometheus.CounterVec `name:"chrysom_polls_total"` -} diff --git a/chrysom/pushResult.go b/chrysom/pushResult.go deleted file mode 100644 index 653eab7e..00000000 --- a/chrysom/pushResult.go +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC -// SPDX-License-Identifier: Apache-2.0 - -package chrysom - -// PushResult is a simple type to indicate the result type for the -// PushItem operation. -type PushResult int64 - -// Types of pushItem successful results. -const ( - UnknownPushResult PushResult = iota - CreatedPushResult - UpdatedPushResult - NilPushResult -) - -func (p PushResult) String() string { - switch p { - case NilPushResult: - return "" - case CreatedPushResult: - return "created" - case UpdatedPushResult: - return "ok" - } - return "unknown" -} diff --git a/chrysom/store.go b/chrysom/store.go deleted file mode 100644 index 28ef771f..00000000 --- a/chrysom/store.go +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC -// SPDX-License-Identifier: Apache-2.0 - -package chrysom - -import ( - "context" - - "github.com/xmidt-org/argus/model" -) - -type PushReader interface { - Pusher - Reader -} - -type Pusher interface { - // PushItem adds the item and establishes its link to the given owner in the store. - PushItem(ctx context.Context, owner string, item model.Item) (PushResult, error) - - // Remove will remove the matching item from the store and return it. - RemoveItem(ctx context.Context, id, owner string) (model.Item, error) -} - -type Listener interface { - // Update is called when we get changes to our item listeners with either - // additions, or updates. - // - // The list of hooks must contain only the current items. - Update(items Items) -} - -type ListenerFunc func(items Items) - -func (l ListenerFunc) Update(items Items) { - l(items) -} - -type Reader interface { - // GeItems returns all the items that belong to this owner. - GetItems(ctx context.Context, owner string) (Items, error) -} - -type ConfigureListener interface { - // SetListener will attempt to set the lister. - SetListener(listener Listener) error -} diff --git a/go.mod b/go.mod index 7284ff67..3e6e1560 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( emperror.dev/emperror v0.33.0 emperror.dev/errors v0.8.1 // indirect - github.com/aws/aws-sdk-go v1.50.26 + github.com/aws/aws-sdk-go v1.54.19 github.com/go-kit/kit v0.13.0 github.com/go-playground/validator/v10 v10.18.0 github.com/gocql/gocql v1.6.0 @@ -14,25 +14,27 @@ require ( github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed github.com/justinas/alice v1.2.0 github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/prometheus/client_golang v1.18.0 + github.com/prometheus/client_golang v1.19.1 github.com/spf13/cast v1.6.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.9.0 github.com/xmidt-org/arrange v0.4.0 - github.com/xmidt-org/bascule v0.11.6 + github.com/xmidt-org/bascule v0.11.7 github.com/xmidt-org/candlelight v0.0.19 github.com/xmidt-org/clortho v0.0.4 github.com/xmidt-org/httpaux v0.4.0 github.com/xmidt-org/sallust v0.2.2 github.com/xmidt-org/touchstone v0.1.5 go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.40.0 - go.uber.org/fx v1.20.1 + go.uber.org/fx v1.22.0 go.uber.org/zap v1.27.0 ) require github.com/go-kit/log v0.2.1 // indirect +require github.com/xmidt-org/ancla v0.3.12 + require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect @@ -67,8 +69,8 @@ require ( github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect @@ -107,3 +109,5 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/xmidt-org/ancla => /Users/mforti446/Documents/work/xmidt-repos/ancla diff --git a/go.sum b/go.sum index 4b7fb135..55b469af 100644 --- a/go.sum +++ b/go.sum @@ -74,9 +74,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go v1.50.26 h1:tuv8+dje59DBK1Pj65tSCdD36oamBxKYJgbng4bFylc= -github.com/aws/aws-sdk-go v1.50.26/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI= +github.com/aws/aws-sdk-go v1.54.19/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -411,20 +410,20 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= @@ -490,8 +489,8 @@ github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4d github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/xmidt-org/arrange v0.4.0 h1:DmJJTK58C44B4efyBV78SmMH0mn0G54n3caVn5BopUU= github.com/xmidt-org/arrange v0.4.0/go.mod h1:MA1eKUZYxaSMIKJL3D/iJEMQruiefmhq+s5E9J4UJv0= -github.com/xmidt-org/bascule v0.11.6 h1:i46FAI97XPMt3OKraiNyKa+mt36AhLO8iuInAypXKNM= -github.com/xmidt-org/bascule v0.11.6/go.mod h1:BXb5PEm/tjqdiEGsd+phm+fItMJx+Huv6LTCEU/zTzg= +github.com/xmidt-org/bascule v0.11.7 h1:+pasCXM+irFuBB4HgO67xC7VHuygjmlmFjEpJdBGXeQ= +github.com/xmidt-org/bascule v0.11.7/go.mod h1:SyAUlH8Y77Iq97u2d4Q7d9ldE7pCqNuQq7bFcl05zwo= github.com/xmidt-org/candlelight v0.0.19 h1:ty6HfSsnbtcK7pmMbA642c+urDg24NlD/c78fJDwrP0= github.com/xmidt-org/candlelight v0.0.19/go.mod h1:QgvMOh6QhoRvAXBzNI8+WfwY0PjEQrm903NitY/LdP4= github.com/xmidt-org/chronon v0.1.1 h1:SzOYkT/nmps3jH4sWu6A52ToKvv5Bu0Gb45/ec5Ty9U= @@ -550,14 +549,12 @@ go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lI go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/dig v1.15.0/go.mod h1:pKHs0wMynzL6brANhB2hLMro+zalv1osARTviTcqHLM= go.uber.org/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc= go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/fx v1.18.1/go.mod h1:g0V1KMQ66zIRk8bLu3Ea5Jt2w/cHlOIp4wdRsgh0JaY= -go.uber.org/fx v1.20.1 h1:zVwVQGS8zYvhh9Xxcu4w1M6ESyeMzebzj2NbSayZ4Mk= -go.uber.org/fx v1.20.1/go.mod h1:iSYNbHf2y55acNCwCXKx7LbWb5WG1Bnue5RDXz1OREg= +go.uber.org/fx v1.22.0 h1:pApUK7yL0OUHMd8vkunWSlLxZVFFk70jR2nKde8X2NM= +go.uber.org/fx v1.22.0/go.mod h1:HT2M7d7RHo+ebKGh9NRcrsrHHfpZ60nW3QRubMRfv48= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= diff --git a/model/model.go b/model/model.go deleted file mode 100644 index 2aa222cc..00000000 --- a/model/model.go +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC -// SPDX-License-Identifier: Apache-2.0 - -package model - -// Key defines the field mapping to retrieve an item from storage. -type Key struct { - // Bucket is the name for a collection or partition to which an item belongs. - Bucket string `json:"bucket"` - - // ID is an item's identifier. Note that different buckets may have - // items with the same ID. - ID string `json:"id"` -} - -// Item defines the abstract item to be stored. -type Item struct { - // ID is the unique ID identifying this item. It is recommended this value is the resulting - // value of a SHA256 calculation, using the unique attributes of the object being represented - // (e.g. SHA256()). This will be used by argus to determine uniqueness of objects being stored or updated. - ID string `json:"id"` - - // Data is the JSON object to be stored. Opaque to argus. - Data map[string]interface{} `json:"data"` - - // TTL is the time to live in storage, specified in seconds. - // Optional. When not set, items don't expire. - TTL *int64 `json:"ttl,omitempty"` -} diff --git a/store/cassandra/db.go b/store/cassandra/db.go index ecad2458..0af7b43c 100644 --- a/store/cassandra/db.go +++ b/store/cassandra/db.go @@ -11,7 +11,7 @@ import ( "emperror.dev/emperror" "github.com/gocql/gocql" "github.com/prometheus/client_golang/prometheus" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" "github.com/xmidt-org/argus/store/db/metric" diff --git a/store/cassandra/executer.go b/store/cassandra/executer.go index 6accee6c..ec4ef7f7 100644 --- a/store/cassandra/executer.go +++ b/store/cassandra/executer.go @@ -10,7 +10,7 @@ import ( "github.com/gocql/gocql" "github.com/hailocab/go-hostpool" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" ) diff --git a/store/dynamodb/db.go b/store/dynamodb/db.go index 6349c71b..7c124f33 100644 --- a/store/dynamodb/db.go +++ b/store/dynamodb/db.go @@ -11,7 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/go-playground/validator/v10" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" "github.com/xmidt-org/argus/store/db/metric" "github.com/xmidt-org/httpaux/erraux" diff --git a/store/dynamodb/db_test.go b/store/dynamodb/db_test.go index 2bbc9cdb..550ae028 100644 --- a/store/dynamodb/db_test.go +++ b/store/dynamodb/db_test.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" ) diff --git a/store/dynamodb/instrumenting.go b/store/dynamodb/instrumenting.go index 04a98334..a313f676 100644 --- a/store/dynamodb/instrumenting.go +++ b/store/dynamodb/instrumenting.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/prometheus/client_golang/prometheus" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" "github.com/xmidt-org/argus/store/db/metric" ) diff --git a/store/dynamodb/instrumenting_test.go b/store/dynamodb/instrumenting_test.go index dc7dd10d..b02a7a57 100644 --- a/store/dynamodb/instrumenting_test.go +++ b/store/dynamodb/instrumenting_test.go @@ -12,7 +12,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" "github.com/xmidt-org/argus/store/db/metric" "github.com/xmidt-org/touchstone/touchtest" diff --git a/store/dynamodb/mocks_test.go b/store/dynamodb/mocks_test.go index f328fc23..f175fca1 100644 --- a/store/dynamodb/mocks_test.go +++ b/store/dynamodb/mocks_test.go @@ -6,7 +6,7 @@ package dynamodb import ( "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/stretchr/testify/mock" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" ) diff --git a/store/dynamodb/service.go b/store/dynamodb/service.go index 10930134..7b316ee2 100644 --- a/store/dynamodb/service.go +++ b/store/dynamodb/service.go @@ -12,7 +12,7 @@ import ( "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" "github.com/xmidt-org/argus/store/db/metric" ) diff --git a/store/dynamodb/service_test.go b/store/dynamodb/service_test.go index 6a03aa7b..2c319695 100644 --- a/store/dynamodb/service_test.go +++ b/store/dynamodb/service_test.go @@ -14,7 +14,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" "github.com/xmidt-org/argus/store/db/metric" "github.com/xmidt-org/touchstone/touchtest" diff --git a/store/endpoint_test.go b/store/endpoint_test.go index e53ec188..a16d012b 100644 --- a/store/endpoint_test.go +++ b/store/endpoint_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" ) func TestGetItemEndpoint(t *testing.T) { diff --git a/store/errors.go b/store/errors.go index c47a0c9e..ac2ab01f 100644 --- a/store/errors.go +++ b/store/errors.go @@ -7,7 +7,7 @@ import ( "fmt" "net/http" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/httpaux/erraux" ) diff --git a/store/handler.go b/store/handler.go index f753f85d..1a245df1 100644 --- a/store/handler.go +++ b/store/handler.go @@ -10,7 +10,7 @@ import ( "net/http" kithttp "github.com/go-kit/kit/transport/http" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "go.uber.org/fx" "go.uber.org/zap" ) diff --git a/store/inmem/InMem.go b/store/inmem/InMem.go index cdddd662..03dcb12c 100644 --- a/store/inmem/InMem.go +++ b/store/inmem/InMem.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" ) diff --git a/store/inmem/InMem_test.go b/store/inmem/InMem_test.go index c33d8e0b..b2e90bd3 100644 --- a/store/inmem/InMem_test.go +++ b/store/inmem/InMem_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" ) diff --git a/store/inputValidation.go b/store/inputValidation.go index 255ed236..001fc4a0 100644 --- a/store/inputValidation.go +++ b/store/inputValidation.go @@ -8,7 +8,7 @@ import ( "time" "github.com/spf13/cast" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" ) // IDFormatRegexSource helps validate the ID on incoming requests. diff --git a/store/mocks_test.go b/store/mocks_test.go index 67cfd4ee..231199c7 100644 --- a/store/mocks_test.go +++ b/store/mocks_test.go @@ -7,7 +7,7 @@ package store import ( "github.com/stretchr/testify/mock" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" ) type MockDAO struct { diff --git a/store/store.go b/store/store.go index 7c3e6e34..9a8c273e 100644 --- a/store/store.go +++ b/store/store.go @@ -6,7 +6,7 @@ package store import ( - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" ) const ( diff --git a/store/test/mocks.go b/store/test/mocks.go index 98169c1a..54a44dd6 100644 --- a/store/test/mocks.go +++ b/store/test/mocks.go @@ -5,7 +5,7 @@ package test import ( "github.com/stretchr/testify/mock" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" ) diff --git a/store/test/storetest.go b/store/test/storetest.go index f421977d..b8b25b6e 100644 --- a/store/test/storetest.go +++ b/store/test/storetest.go @@ -8,7 +8,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/xmidt-org/argus/model" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/store" ) diff --git a/store/transport.go b/store/transport.go index 2fe16ff4..7304abe5 100644 --- a/store/transport.go +++ b/store/transport.go @@ -16,8 +16,8 @@ import ( kithttp "github.com/go-kit/kit/transport/http" "github.com/gorilla/mux" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/auth" - "github.com/xmidt-org/argus/model" "github.com/xmidt-org/bascule" "go.uber.org/zap" ) diff --git a/store/transport_test.go b/store/transport_test.go index 7d04107b..e16c037e 100644 --- a/store/transport_test.go +++ b/store/transport_test.go @@ -16,8 +16,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/gorilla/mux" "github.com/stretchr/testify/assert" + "github.com/xmidt-org/ancla/model" "github.com/xmidt-org/argus/auth" - "github.com/xmidt-org/argus/model" "github.com/xmidt-org/bascule" "github.com/xmidt-org/httpaux/erraux" "github.com/xmidt-org/sallust" From 838b5aa9568a6ce629a03e3d755d612e738e3858 Mon Sep 17 00:00:00 2001 From: maura fortino Date: Thu, 18 Jul 2024 16:50:29 -0400 Subject: [PATCH 4/4] removed chrysom and model and updated with new ancla --- go.mod | 4 +--- go.sum | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3e6e1560..8ac75fb7 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( require github.com/go-kit/log v0.2.1 // indirect -require github.com/xmidt-org/ancla v0.3.12 +require github.com/xmidt-org/ancla v0.3.13-0.20240718193746-a3cd5a39560c require ( github.com/beorn7/perks v1.0.1 // indirect @@ -109,5 +109,3 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/xmidt-org/ancla => /Users/mforti446/Documents/work/xmidt-repos/ancla diff --git a/go.sum b/go.sum index 55b469af..73616c54 100644 --- a/go.sum +++ b/go.sum @@ -487,6 +487,8 @@ github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSW github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/xmidt-org/ancla v0.3.13-0.20240718193746-a3cd5a39560c h1:8mXbUarqTLzJVnMETH5lVEkHXR09bEys3WEixeRXIx0= +github.com/xmidt-org/ancla v0.3.13-0.20240718193746-a3cd5a39560c/go.mod h1:YSieNJd7PuZ6Nppce9OQnDdjgNWvwa9iiVjtenetmwo= github.com/xmidt-org/arrange v0.4.0 h1:DmJJTK58C44B4efyBV78SmMH0mn0G54n3caVn5BopUU= github.com/xmidt-org/arrange v0.4.0/go.mod h1:MA1eKUZYxaSMIKJL3D/iJEMQruiefmhq+s5E9J4UJv0= github.com/xmidt-org/bascule v0.11.7 h1:+pasCXM+irFuBB4HgO67xC7VHuygjmlmFjEpJdBGXeQ=