feat: change from impp prefix to just im

This commit is contained in:
beltram 2023-03-06 13:53:26 +01:00 committed by Herman Slatman
parent b6ec4422b4
commit 3f474f77d4
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F
3 changed files with 8 additions and 8 deletions

View File

@ -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)
}

View File

@ -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:

View File

@ -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 {