From 3f474f77d4bb3e1018fa4a69f381f5c7f9f8d151 Mon Sep 17 00:00:00 2001 From: beltram Date: Mon, 6 Mar 2023 13:53:26 +0100 Subject: [PATCH] feat: change from impp prefix to just im --- acme/api/im_integration_test.go | 6 +++--- acme/api/order.go | 2 +- acme/api/order_test.go | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/acme/api/im_integration_test.go b/acme/api/im_integration_test.go index fab51dd7..0f662c12 100644 --- a/acme/api/im_integration_test.go +++ b/acme/api/im_integration_test.go @@ -199,7 +199,7 @@ func TestIMIntegration(t *testing.T) { Identifiers: []acme.Identifier{ { Type: "wireapp-id", - Value: `{"name": "Smith, Alice M (QA)", "domain": "example.com", "client-id": "impp:wireapp=75d73550-16e0-4027-abfd-0137e32180cc/ed416ce8ecdd9fad@example.com", "handle": "impp:wireapp=alice.smith.qa@example.com"}`, + Value: `{"name": "Smith, Alice M (QA)", "domain": "example.com", "client-id": "im:wireapp=75d73550-16e0-4027-abfd-0137e32180cc/ed416ce8ecdd9fad@example.com", "handle": "im:wireapp=alice.smith.qa@example.com"}`, }, }, } @@ -377,12 +377,12 @@ func TestIMIntegration(t *testing.T) { }, }) - qUserID, err := url.Parse("impp:wireapp=75d73550-16e0-4027-abfd-0137e32180cc/ed416ce8ecdd9fad@example.com") + qUserID, err := url.Parse("im:wireapp=75d73550-16e0-4027-abfd-0137e32180cc/ed416ce8ecdd9fad@example.com") if err != nil { t.Fatal("parse user ID URI", err) } _ = qUserID - qUserName, err := url.Parse("impp:wireapp=alice.smith.qa@example.com") + qUserName, err := url.Parse("im:wireapp=alice.smith.qa@example.com") if err != nil { t.Fatal("parse user name URI", err) } diff --git a/acme/api/order.go b/acme/api/order.go index bb586f59..88ca9ddf 100644 --- a/acme/api/order.go +++ b/acme/api/order.go @@ -54,7 +54,7 @@ func (n *NewOrderRequest) Validate() error { if err != nil { return acme.NewError(acme.ErrorMalformedType, "ID cannot be parsed") } - if !strings.HasPrefix(orderValue.ClientID, "impp:wireapp=") { + if !strings.HasPrefix(orderValue.ClientID, "im:wireapp=") { return acme.NewError(acme.ErrorMalformedType, "missing client ID prefix") } default: diff --git a/acme/api/order_test.go b/acme/api/order_test.go index d5e34801..8dbd14af 100644 --- a/acme/api/order_test.go +++ b/acme/api/order_test.go @@ -190,7 +190,7 @@ func TestNewOrderRequest_Validate(t *testing.T) { return test{ nor: &NewOrderRequest{ Identifiers: []acme.Identifier{ - {Type: "wireapp-id", Value: `{"name": "Smith, Alice M (QA)", "domain": "example.com", "client-id": "impp:wireapp=75d73550-16e0-4027-abfd-0137e32180cc/ed416ce8ecdd9fad@example.com", "handle": "impp:wireapp=alice.smith.qa@example.com"}`}, + {Type: "wireapp-id", Value: `{"name": "Smith, Alice M (QA)", "domain": "example.com", "client-id": "im:wireapp=75d73550-16e0-4027-abfd-0137e32180cc/ed416ce8ecdd9fad@example.com", "handle": "im:wireapp=alice.smith.qa@example.com"}`}, }, NotAfter: naf, NotBefore: nbf, @@ -785,7 +785,7 @@ func TestHandler_newAuthorization(t *testing.T) { AccountID: "accID", Identifier: acme.Identifier{ Type: "wireapp", - Value: "impp:wireapp=user/client@domain", + Value: "im:wireapp=user/client@domain", }, Status: acme.StatusPending, ExpiresAt: clock.Now(), @@ -1699,7 +1699,7 @@ func TestHandler_NewOrder(t *testing.T) { acc := &acme.Account{ID: "accID"} nor := &NewOrderRequest{ Identifiers: []acme.Identifier{ - {Type: "wireapp-id", Value: `{"client-id": "impp:wireapp=user/client@domain"}`}, + {Type: "wireapp-id", Value: `{"client-id": "im:wireapp=user/client@domain"}`}, }, } b, err := json.Marshal(nor) @@ -1736,7 +1736,7 @@ func TestHandler_NewOrder(t *testing.T) { assert.Equals(t, ch.AccountID, "accID") assert.NotEquals(t, ch.Token, "") assert.Equals(t, ch.Status, acme.StatusPending) - assert.Equals(t, ch.Value, `{"client-id": "impp:wireapp=user/client@domain"}`) + assert.Equals(t, ch.Value, `{"client-id": "im:wireapp=user/client@domain"}`) return nil }, MockCreateAuthorization: func(ctx context.Context, az *acme.Authorization) error {