Make the example Wire handle consistent

This commit is contained in:
Herman Slatman 2024-01-15 19:44:02 +01:00
parent bca179d611
commit c46434f6e0
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

View File

@ -52,6 +52,8 @@ func newWireProvisionerWithOptions(t *testing.T, options *provisioner.Options) *
return a return a
} }
// TODO(hs): replace with test CA server + acmez based test client for
// more realistic integration test?
func TestWireIntegration(t *testing.T) { func TestWireIntegration(t *testing.T) {
fakeKey := `-----BEGIN PUBLIC KEY----- fakeKey := `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEA5c+4NKZSNQcR1T8qN6SjwgdPZQ0Ge12Ylx/YeGAJ35k= MCowBQYDK2VwAyEA5c+4NKZSNQcR1T8qN6SjwgdPZQ0Ge12Ylx/YeGAJ35k=
@ -313,7 +315,7 @@ MCowBQYDK2VwAyEA5c+4NKZSNQcR1T8qN6SjwgdPZQ0Ge12Ylx/YeGAJ35k=
t.Log("updated challenge:", challenge.ID, challenge.Status) t.Log("updated challenge:", challenge.ID, challenge.Status)
switch challenge.Type { switch challenge.Type {
case acme.WIREOIDC01: case acme.WIREOIDC01:
err = db.CreateOidcToken(ctx, order.ID, map[string]any{"name": "Smith, Alice M (QA)", "handle": "%40alice.smith.qa@example.com"}) err = db.CreateOidcToken(ctx, order.ID, map[string]any{"name": "Smith, Alice M (QA)", "handle": "wireapp://%40alice.smith.qa@example.com"})
require.NoError(t, err) require.NoError(t, err)
case acme.WIREDPOP01: case acme.WIREDPOP01:
err = db.CreateDpopToken(ctx, order.ID, map[string]any{"sub": "wireapp://lJGYPz0ZRq2kvc_XpdaDlA!ed416ce8ecdd9fad@example.com"}) err = db.CreateDpopToken(ctx, order.ID, map[string]any{"sub": "wireapp://lJGYPz0ZRq2kvc_XpdaDlA!ed416ce8ecdd9fad@example.com"})
@ -374,7 +376,7 @@ MCowBQYDK2VwAyEA5c+4NKZSNQcR1T8qN6SjwgdPZQ0Ge12Ylx/YeGAJ35k=
cert, err := ca.Sign(template) cert, err := ca.Sign(template)
require.NoError(t, err) require.NoError(t, err)
u1, err := url.Parse("%40alice.smith.qa@example.com") u1, err := url.Parse("wireapp://%40alice.smith.qa@example.com")
require.NoError(t, err) require.NoError(t, err)
u2, err := url.Parse("wireapp://lJGYPz0ZRq2kvc_XpdaDlA%21ed416ce8ecdd9fad@example.com") u2, err := url.Parse("wireapp://lJGYPz0ZRq2kvc_XpdaDlA%21ed416ce8ecdd9fad@example.com")
require.NoError(t, err) require.NoError(t, err)