From e0aa469dde51faf36e54626f57b04dfd99436463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Thu, 23 Nov 2023 13:22:07 +0100 Subject: [PATCH 1/5] ContractsAPI: Replace flat key names with structured data The structure went from { "contract_token": "this-is-a-token" } to: { "subscriptionEntitlements": [ "9N9Q5G4QSMLS:0100": { "token": "this-is-a-token" } ] } So simply storing the key names as constants is not quite enough. We instead use structs as defined in the contract server back-end. --- contractsapi/contractsapi.go | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/contractsapi/contractsapi.go b/contractsapi/contractsapi.go index bfa4773d0..eea585d6a 100644 --- a/contractsapi/contractsapi.go +++ b/contractsapi/contractsapi.go @@ -17,10 +17,31 @@ const ( //nolint:gosec // G101 false positive, this is not a credential // ADTokenKey is the JSON key of the response payload of the /token endpoint. ADTokenKey = "azure_ad_token" +) - // JWTKey is the JSON key of the request payload of the /susbcription endpoint. - JWTKey = "ms_store_id_key" +// SubscriptionRequest is the expected request body in json format for +// "/v1/subscription" endpoint. +// +// Must keep in sync with +// https://github.com/canonical/cloud-contracts/blob/develop/wslsaas/internal/apiv1/apiv1.go#L58 +type SubscriptionRequest struct { + // MSStoreIDKey is the user token generated on Ubuntu Pro Windows client using + // Windows SDK. + MSStoreIDKey string `json:"ms_store_id_key"` +} - // ProTokenKey is the JSON key of a successful response payload of the /subscription endpoint. - ProTokenKey = "contract_token" -) +// SyncUserSubscriptionsResponseItem is an indvidual subscription for the response to /v1/subscription. +// +// Must keep in sync with: +// https://github.com/canonical/cloud-contracts/blob/develop/wslsaas/internal/apiv1/apiv1.go#L64 +type SyncUserSubscriptionsResponseItem struct { + Token string `json:"contractToken"` +} + +// SyncUserSubscriptionsResponse is the structure for json response for /v1/subscription. +// +// Must keep in sync with +// https://github.com/canonical/cloud-contracts/blob/develop/wslsaas/internal/apiv1/apiv1.go#L69 +type SyncUserSubscriptionsResponse struct { + SubscriptionEntitlements map[string]SyncUserSubscriptionsResponseItem `json:"subscriptionEntitlements"` +} From 55235581dbc0526f0019531117cb09fb16eff6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Thu, 23 Nov 2023 13:29:40 +0100 Subject: [PATCH 2/5] Patch mock contract server to use new JSON schemas --- .../contractsmockserver.go | 26 ++++++++++++------- .../microsoftstore/store_windows.go | 6 +++-- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/mocks/contractserver/contractsmockserver/contractsmockserver.go b/mocks/contractserver/contractsmockserver/contractsmockserver.go index a717f6060..e7485718a 100644 --- a/mocks/contractserver/contractsmockserver/contractsmockserver.go +++ b/mocks/contractserver/contractsmockserver/contractsmockserver.go @@ -10,6 +10,7 @@ import ( "github.com/canonical/ubuntu-pro-for-windows/contractsapi" "github.com/canonical/ubuntu-pro-for-windows/mocks/restserver" + "github.com/canonical/ubuntu-pro-for-windows/storeapi/go-wrapper/microsoftstore" ) const ( @@ -85,27 +86,32 @@ func (s *Server) handleSubscription(w http.ResponseWriter, r *http.Request) { return } - var data map[string]string - if err := json.NewDecoder(r.Body).Decode(&data); err != nil { + var req contractsapi.SubscriptionRequest + + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { w.WriteHeader(http.StatusBadRequest) fmt.Fprintln(w, "Bad Request") return } - userJWT, ok := data[contractsapi.JWTKey] - if !ok { + if req.MSStoreIDKey == "" { w.WriteHeader(http.StatusBadRequest) - fmt.Fprintln(w, "JSON payload does not contain the expected key") + fmt.Fprintln(w, "JWT cannot be empty") return } - if len(userJWT) == 0 { - w.WriteHeader(http.StatusBadRequest) - fmt.Fprintln(w, "JWT cannot be empty") - return + // In the server, the ID for the product is "ProductID:SKU". + // Here we choose some arbitrary number for the SKU. + id := microsoftstore.ProductID + ":0001" + + resp := contractsapi.SyncUserSubscriptionsResponse{ + SubscriptionEntitlements: map[string]contractsapi.SyncUserSubscriptionsResponseItem{ + id: {Token: s.settings.Subscription.OnSuccess.Value}, + "ABCDEFGHIJKL": {Token: "a-token-for-some-other-subscription"}, + }, } - if _, err := fmt.Fprintf(w, `{%q: %q}`, contractsapi.ProTokenKey, s.settings.Subscription.OnSuccess.Value); err != nil { + if err := json.NewEncoder(w).Encode(resp); err != nil { w.WriteHeader(http.StatusInternalServerError) fmt.Fprintf(w, "failed to write the response: %v", err) return diff --git a/storeapi/go-wrapper/microsoftstore/store_windows.go b/storeapi/go-wrapper/microsoftstore/store_windows.go index 9ce3b40a5..007f171e1 100644 --- a/storeapi/go-wrapper/microsoftstore/store_windows.go +++ b/storeapi/go-wrapper/microsoftstore/store_windows.go @@ -14,8 +14,10 @@ import ( ) const ( + // ProductID is the ID of the product in the Microsoft Store + // // TODO: Replace with real product ID. - productID = "9P25B50XMKXT" + ProductID = "9P25B50XMKXT" ) var ( @@ -62,7 +64,7 @@ func GenerateUserJWT(azureADToken string) (jwt string, err error) { func GetSubscriptionExpirationDate() (tm time.Time, err error) { defer decorate.OnError(&err, "GetSubscriptionExpirationDate") - prodID, err := syscall.BytePtrFromString(productID) + prodID, err := syscall.BytePtrFromString(ProductID) if err != nil { return time.Time{}, fmt.Errorf("could not convert the productID to a byte array: %v", err) } From f4a70eaa8ad9304d0ec3281b4db87b0fc32d6600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Thu, 23 Nov 2023 13:50:28 +0100 Subject: [PATCH 3/5] Patch contract client to use new JSON schema --- .../contracts/contractclient/client.go | 31 +++++++++++++------ .../contracts/contractclient/client_test.go | 20 ++++++++++-- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/windows-agent/internal/contracts/contractclient/client.go b/windows-agent/internal/contracts/contractclient/client.go index cd879e50e..eed48f796 100644 --- a/windows-agent/internal/contracts/contractclient/client.go +++ b/windows-agent/internal/contracts/contractclient/client.go @@ -10,8 +10,10 @@ import ( "io" "net/http" "net/url" + "strings" "github.com/canonical/ubuntu-pro-for-windows/contractsapi" + "github.com/canonical/ubuntu-pro-for-windows/storeapi/go-wrapper/microsoftstore" "github.com/ubuntu/decorate" ) @@ -88,9 +90,12 @@ func (c *Client) GetProToken(ctx context.Context, userJWT string) (token string, // baseurl/v1/subscription. u := c.baseURL.JoinPath(contractsapi.Version, contractsapi.SubscriptionPath) - jsonData, err := json.Marshal(map[string]string{contractsapi.JWTKey: userJWT}) + + jsonData, err := json.Marshal(contractsapi.SubscriptionRequest{ + MSStoreIDKey: userJWT, + }) if err != nil { - return "", err + return "", fmt.Errorf("could not encode the request: %v", err) } req, err := http.NewRequestWithContext(ctx, http.MethodPost, u.String(), bytes.NewReader(jsonData)) @@ -122,17 +127,25 @@ func (c *Client) GetProToken(ctx context.Context, userJWT string) (token string, case http.StatusOK: } - var data map[string]string - if err := json.NewDecoder(res.Body).Decode(&data); err != nil { - return "", err + var resp contractsapi.SyncUserSubscriptionsResponse + if err := json.NewDecoder(res.Body).Decode(&resp); err != nil { + return "", fmt.Errorf("could not decode the response: %v", err) } - val, ok := data[contractsapi.ProTokenKey] - if !ok { - return "", fmt.Errorf("expected key %q not found in the response", contractsapi.ProTokenKey) + for product, subscription := range resp.SubscriptionEntitlements { + if !strings.HasPrefix(product, microsoftstore.ProductID) { + continue + } + + if subscription.Token == "" { + // Some other entry may contain the token? + continue + } + + return subscription.Token, nil } - return val, nil + return "", fmt.Errorf("response did not contain any valid subscriptions: %s", res.Body) } // checkLength sanity checks that 0 < length < apiTokenMaxSize. diff --git a/windows-agent/internal/contracts/contractclient/client_test.go b/windows-agent/internal/contracts/contractclient/client_test.go index cbb3d5560..bb8b9545b 100644 --- a/windows-agent/internal/contracts/contractclient/client_test.go +++ b/windows-agent/internal/contracts/contractclient/client_test.go @@ -15,6 +15,7 @@ import ( "github.com/canonical/ubuntu-pro-for-windows/contractsapi" "github.com/canonical/ubuntu-pro-for-windows/mocks/contractserver/contractsmockserver" + "github.com/canonical/ubuntu-pro-for-windows/storeapi/go-wrapper/microsoftstore" "github.com/canonical/ubuntu-pro-for-windows/windows-agent/internal/contracts/contractclient" "github.com/stretchr/testify/require" ) @@ -95,6 +96,20 @@ func TestGetProToken(t *testing.T) { goodToken := strings.Repeat("Token", 256) + responseWithToken := func(t *testing.T, token string) []byte { + t.Helper() + + r, err := json.Marshal(contractsapi.SyncUserSubscriptionsResponse{ + SubscriptionEntitlements: map[string]contractsapi.SyncUserSubscriptionsResponseItem{ + microsoftstore.ProductID + ":0001": {Token: token}, + "SOME_OTHER_PRODUCT:0002": {Token: "token-to-ignore"}, + }, + }) + + require.NoError(t, err, "Setup: unexpected error when marshalling the good token") + return r + } + testCases := map[string]struct { jwt string @@ -116,6 +131,7 @@ func TestGetProToken(t *testing.T) { "Error with expected key not in response": {responseContent: []byte(`{"unexpected_key": "unexpected_value"}`), wantErr: true}, "Error on http.Do": {errorOnDo: true, wantErr: true}, "Error with invalid JSON": {responseContent: []byte("invalid JSON"), wantErr: true}, + "Error with empty token": {responseContent: responseWithToken(t, ""), wantErr: true}, "Error with unexpected status code": {statusCode: 422, wantErr: true}, "Error with empty response body": {responseContent: []byte(""), wantErr: true}, "Error with unknown response length": {unknownContentLength: true, wantErr: true}, @@ -139,9 +155,7 @@ func TestGetProToken(t *testing.T) { } if tc.responseContent == nil { - var err error - tc.responseContent, err = json.Marshal(map[string]string{contractsapi.ProTokenKey: goodToken}) - require.NoError(t, err, "Setup: unexpected error when marshalling the good token") + tc.responseContent = responseWithToken(t, goodToken) } l := int64(len(tc.responseContent)) From fb722497277ac885175711b7a4a7bad239858646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Thu, 23 Nov 2023 14:32:57 +0100 Subject: [PATCH 4/5] Move product ID to the common package --- common/consts.go | 5 +++++ .../contractsmockserver/contractsmockserver.go | 4 ++-- storeapi/go-wrapper/microsoftstore/store_windows.go | 10 ++-------- .../internal/contracts/contractclient/client.go | 4 ++-- .../internal/contracts/contractclient/client_test.go | 6 +++--- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/common/consts.go b/common/consts.go index 4e545a0a9..958009815 100644 --- a/common/consts.go +++ b/common/consts.go @@ -11,4 +11,9 @@ const ( // ListeningPortFileName corresponds to the base name of the file hosting the addressing of our GRPC server. ListeningPortFileName = "addr" + + // MsStoreProductID is the ID of the product in the Microsoft Store + // + // TODO: Replace with real product ID. + MsStoreProductID = "9P25B50XMKXT" ) diff --git a/mocks/contractserver/contractsmockserver/contractsmockserver.go b/mocks/contractserver/contractsmockserver/contractsmockserver.go index e7485718a..d0454236d 100644 --- a/mocks/contractserver/contractsmockserver/contractsmockserver.go +++ b/mocks/contractserver/contractsmockserver/contractsmockserver.go @@ -8,9 +8,9 @@ import ( "net/http" "path" + "github.com/canonical/ubuntu-pro-for-windows/common" "github.com/canonical/ubuntu-pro-for-windows/contractsapi" "github.com/canonical/ubuntu-pro-for-windows/mocks/restserver" - "github.com/canonical/ubuntu-pro-for-windows/storeapi/go-wrapper/microsoftstore" ) const ( @@ -102,7 +102,7 @@ func (s *Server) handleSubscription(w http.ResponseWriter, r *http.Request) { // In the server, the ID for the product is "ProductID:SKU". // Here we choose some arbitrary number for the SKU. - id := microsoftstore.ProductID + ":0001" + id := common.MsStoreProductID + ":0001" resp := contractsapi.SyncUserSubscriptionsResponse{ SubscriptionEntitlements: map[string]contractsapi.SyncUserSubscriptionsResponseItem{ diff --git a/storeapi/go-wrapper/microsoftstore/store_windows.go b/storeapi/go-wrapper/microsoftstore/store_windows.go index 007f171e1..dd309754b 100644 --- a/storeapi/go-wrapper/microsoftstore/store_windows.go +++ b/storeapi/go-wrapper/microsoftstore/store_windows.go @@ -9,17 +9,11 @@ import ( "time" "unsafe" + "github.com/canonical/ubuntu-pro-for-windows/common" "github.com/ubuntu/decorate" "golang.org/x/sys/windows" ) -const ( - // ProductID is the ID of the product in the Microsoft Store - // - // TODO: Replace with real product ID. - ProductID = "9P25B50XMKXT" -) - var ( // Loading must be delayed for tests: the path to the DLL is known only relative to this file. // At module load-time, the working directory can be anywhere. @@ -64,7 +58,7 @@ func GenerateUserJWT(azureADToken string) (jwt string, err error) { func GetSubscriptionExpirationDate() (tm time.Time, err error) { defer decorate.OnError(&err, "GetSubscriptionExpirationDate") - prodID, err := syscall.BytePtrFromString(ProductID) + prodID, err := syscall.BytePtrFromString(common.MsStoreProductID) if err != nil { return time.Time{}, fmt.Errorf("could not convert the productID to a byte array: %v", err) } diff --git a/windows-agent/internal/contracts/contractclient/client.go b/windows-agent/internal/contracts/contractclient/client.go index eed48f796..6aa882875 100644 --- a/windows-agent/internal/contracts/contractclient/client.go +++ b/windows-agent/internal/contracts/contractclient/client.go @@ -12,8 +12,8 @@ import ( "net/url" "strings" + "github.com/canonical/ubuntu-pro-for-windows/common" "github.com/canonical/ubuntu-pro-for-windows/contractsapi" - "github.com/canonical/ubuntu-pro-for-windows/storeapi/go-wrapper/microsoftstore" "github.com/ubuntu/decorate" ) @@ -133,7 +133,7 @@ func (c *Client) GetProToken(ctx context.Context, userJWT string) (token string, } for product, subscription := range resp.SubscriptionEntitlements { - if !strings.HasPrefix(product, microsoftstore.ProductID) { + if !strings.HasPrefix(product, common.MsStoreProductID) { continue } diff --git a/windows-agent/internal/contracts/contractclient/client_test.go b/windows-agent/internal/contracts/contractclient/client_test.go index bb8b9545b..b115c77d7 100644 --- a/windows-agent/internal/contracts/contractclient/client_test.go +++ b/windows-agent/internal/contracts/contractclient/client_test.go @@ -13,9 +13,9 @@ import ( "testing" "time" + "github.com/canonical/ubuntu-pro-for-windows/common" "github.com/canonical/ubuntu-pro-for-windows/contractsapi" "github.com/canonical/ubuntu-pro-for-windows/mocks/contractserver/contractsmockserver" - "github.com/canonical/ubuntu-pro-for-windows/storeapi/go-wrapper/microsoftstore" "github.com/canonical/ubuntu-pro-for-windows/windows-agent/internal/contracts/contractclient" "github.com/stretchr/testify/require" ) @@ -101,8 +101,8 @@ func TestGetProToken(t *testing.T) { r, err := json.Marshal(contractsapi.SyncUserSubscriptionsResponse{ SubscriptionEntitlements: map[string]contractsapi.SyncUserSubscriptionsResponseItem{ - microsoftstore.ProductID + ":0001": {Token: token}, - "SOME_OTHER_PRODUCT:0002": {Token: "token-to-ignore"}, + common.MsStoreProductID + ":0001": {Token: token}, + "SOME_OTHER_PRODUCT:0002": {Token: "token-to-ignore"}, }, }) From e4e8c9e7190535badc21b6452275612e40cb4831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Thu, 23 Nov 2023 14:34:54 +0100 Subject: [PATCH 5/5] Update internal dependecies to the common package --- mocks/go.mod | 7 +------ mocks/go.sum | 7 ++----- windows-agent/go.mod | 4 +--- windows-agent/go.sum | 8 ++++---- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/mocks/go.mod b/mocks/go.mod index 69c7d06c0..95a307795 100644 --- a/mocks/go.mod +++ b/mocks/go.mod @@ -4,7 +4,7 @@ go 1.21.4 require ( github.com/canonical/landscape-hostagent-api v0.0.0-20230606055347-dd0b7f618303 - github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20230906090052-60fb5d60ada4 + github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20231123134240-fb722497277a github.com/canonical/ubuntu-pro-for-windows/contractsapi v0.0.0-20230906090052-60fb5d60ada4 github.com/spf13/cobra v1.7.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 @@ -13,17 +13,12 @@ require ( ) require ( - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/spf13/pflag v1.0.5 // indirect golang.org/x/net v0.15.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect ) diff --git a/mocks/go.sum b/mocks/go.sum index ef7f28bea..3e21fd6e2 100644 --- a/mocks/go.sum +++ b/mocks/go.sum @@ -1,11 +1,10 @@ github.com/canonical/landscape-hostagent-api v0.0.0-20230606055347-dd0b7f618303 h1:YfGTcFs5YaJlpR0lxVAPD3oFYcez9Pg1w0MUEbG2zB0= github.com/canonical/landscape-hostagent-api v0.0.0-20230606055347-dd0b7f618303/go.mod h1:3N+AXDrTJvuwy+F9uIDzi2g9xqpeZpxfwobtn84JHEQ= -github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20230906090052-60fb5d60ada4 h1:8gmzKOf7uRSXl+WfGcQNhf9Ua3Xo5eJzo+6G9nNrXTg= -github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20230906090052-60fb5d60ada4/go.mod h1:vNexvsl8a0qQmLwFcmF2dPur0FH4jmMJAPH2VnXN+I0= +github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20231123134240-fb722497277a h1:M+Y+2guVEvikJ2qzv31Bj3t+INzD7MuCAqHoUb8hD9c= +github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20231123134240-fb722497277a/go.mod h1:HWMzmvIFQ3dWWPE4paEDWOMpOkcjFb2akrccYrck+eM= github.com/canonical/ubuntu-pro-for-windows/contractsapi v0.0.0-20230906090052-60fb5d60ada4 h1:0jVDQ6uSC6scEXX6e83sD6Rw6KhD8/7Vr4Ha1ob2CHw= github.com/canonical/ubuntu-pro-for-windows/contractsapi v0.0.0-20230906090052-60fb5d60ada4/go.mod h1:lqO8UB33LPVdfiMDMlc1swo3S9bwqhW8DtO75dgTLWo= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= @@ -16,8 +15,6 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= diff --git a/windows-agent/go.mod b/windows-agent/go.mod index b28b804a1..7983d1501 100644 --- a/windows-agent/go.mod +++ b/windows-agent/go.mod @@ -5,7 +5,7 @@ go 1.21.4 require ( github.com/canonical/landscape-hostagent-api v0.0.0-20230606055347-dd0b7f618303 github.com/canonical/ubuntu-pro-for-windows/agentapi v0.0.0-20230906090052-60fb5d60ada4 - github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20230906090052-60fb5d60ada4 + github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20231123134240-fb722497277a github.com/canonical/ubuntu-pro-for-windows/contractsapi v0.0.0-20230906090052-60fb5d60ada4 github.com/canonical/ubuntu-pro-for-windows/mocks v0.0.0-20230906090052-60fb5d60ada4 github.com/canonical/ubuntu-pro-for-windows/storeapi/go-wrapper/microsoftstore v0.0.0-20230906093332-11c8e171f61b @@ -34,7 +34,6 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/sagikazarmark/locafero v0.3.0 // indirect @@ -50,5 +49,4 @@ require ( golang.org/x/net v0.15.0 // indirect golang.org/x/text v0.13.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect - gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect ) diff --git a/windows-agent/go.sum b/windows-agent/go.sum index 563caef8d..0200a0763 100644 --- a/windows-agent/go.sum +++ b/windows-agent/go.sum @@ -44,8 +44,8 @@ github.com/canonical/landscape-hostagent-api v0.0.0-20230606055347-dd0b7f618303 github.com/canonical/landscape-hostagent-api v0.0.0-20230606055347-dd0b7f618303/go.mod h1:3N+AXDrTJvuwy+F9uIDzi2g9xqpeZpxfwobtn84JHEQ= github.com/canonical/ubuntu-pro-for-windows/agentapi v0.0.0-20230906090052-60fb5d60ada4 h1:4OTCHKf99VSKfrTf6IPyEDZhUiNygLNhZJoEn42lh2g= github.com/canonical/ubuntu-pro-for-windows/agentapi v0.0.0-20230906090052-60fb5d60ada4/go.mod h1:NtQF6rRjaPTVi2TDspYsq6z4+HQXEpL878oSsN+7iEQ= -github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20230906090052-60fb5d60ada4 h1:8gmzKOf7uRSXl+WfGcQNhf9Ua3Xo5eJzo+6G9nNrXTg= -github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20230906090052-60fb5d60ada4/go.mod h1:vNexvsl8a0qQmLwFcmF2dPur0FH4jmMJAPH2VnXN+I0= +github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20231123134240-fb722497277a h1:M+Y+2guVEvikJ2qzv31Bj3t+INzD7MuCAqHoUb8hD9c= +github.com/canonical/ubuntu-pro-for-windows/common v0.0.0-20231123134240-fb722497277a/go.mod h1:HWMzmvIFQ3dWWPE4paEDWOMpOkcjFb2akrccYrck+eM= github.com/canonical/ubuntu-pro-for-windows/contractsapi v0.0.0-20230906090052-60fb5d60ada4 h1:0jVDQ6uSC6scEXX6e83sD6Rw6KhD8/7Vr4Ha1ob2CHw= github.com/canonical/ubuntu-pro-for-windows/contractsapi v0.0.0-20230906090052-60fb5d60ada4/go.mod h1:lqO8UB33LPVdfiMDMlc1swo3S9bwqhW8DtO75dgTLWo= github.com/canonical/ubuntu-pro-for-windows/mocks v0.0.0-20230906090052-60fb5d60ada4 h1:V6mnKw1LBnVyWAa6/G6uumbpL8wrhI1LZu4nJbc9nCk= @@ -176,8 +176,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U=