Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove rusty-jwt-cli #1670

Merged
merged 48 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
29fa662
Remove the Wire CLI invocatation
hslatman Jan 10, 2024
033aef9
Merge branch 'wire-acme-extensions' into herman/remove-rusty-cli
hslatman Jan 10, 2024
a423151
Merge branch 'wire-acme-extensions' into herman/remove-rusty-cli
hslatman Jan 10, 2024
c7892e9
Remove the `rusty-jwt-cli` configuration
hslatman Jan 10, 2024
897688a
Merge branch 'wire-acme-extensions' into herman/remove-rusty-cli
hslatman Jan 11, 2024
cd9480a
Fix test for `parseAndVerifyWireAccessToken`
hslatman Jan 11, 2024
acad227
Put Wire options in lower level `wire` struct
hslatman Jan 11, 2024
b964c97
Add validation of `handle` and `token` to Wire verification
hslatman Jan 11, 2024
b6fc000
Add verification of maximum expiry time for Wire tokens
hslatman Jan 11, 2024
6ef64b6
Refactor the `Wire` option configuration
hslatman Jan 11, 2024
1f5f756
Make Wire options more robust
hslatman Jan 11, 2024
1bf807a
Use base64 encoded signing key format
hslatman Jan 11, 2024
348363a
Add Wire `DPoP` proof claims verification
hslatman Jan 11, 2024
44721a7
Remove debug err print
hslatman Jan 11, 2024
7eacb68
Merge branch 'herman/remove-rusty-cli' into herman/wire-configuration…
hslatman Jan 11, 2024
79739e5
Change signature algorithm property name
hslatman Jan 12, 2024
2479572
Perform initialization of DPoP and OIDC options once
hslatman Jan 12, 2024
c8160ca
Fix test; reworded error message
hslatman Jan 12, 2024
3f37fea
Merge pull request #1671 from smallstep/herman/wire-configuration-ref…
hslatman Jan 12, 2024
9bb1b24
Change `kid` and `dpop` validation
hslatman Jan 12, 2024
2c27e86
Fix linting issue
hslatman Jan 12, 2024
0ad381b
Add OIDC token template transformation
hslatman Jan 12, 2024
d5b0d92
Fix Wire ID token test comment
hslatman Jan 12, 2024
29202ef
Add support for functions in OIDC token transformation template
hslatman Jan 15, 2024
768a089
Store transformed OIDC token
hslatman Jan 15, 2024
7d5a791
Add tests for Wire `OIDC` and `DPoP` token persistence
hslatman Jan 15, 2024
2efd1f6
Fix expected error type check
hslatman Jan 15, 2024
bca179d
Make the Wire API integration test a bit more like the real flow
hslatman Jan 15, 2024
c46434f
Make the example Wire handle consistent
hslatman Jan 15, 2024
a2304c8
Add tests for Wire ID parsing
hslatman Jan 15, 2024
d84abac
Add test for `wireOIDC01Validate`
hslatman Jan 15, 2024
8f129a6
Add test for `wireDPOP01Validate`
hslatman Jan 15, 2024
a24b2a5
Add test case for `validateWireOIDCClaims`
hslatman Jan 16, 2024
7520736
Improve test coverage for `wireDPOP01Validate`
hslatman Jan 16, 2024
37106a4
Fix Wire integration test by acting on realistic access/dpop token
hslatman Jan 16, 2024
99934ec
Improve test coverage for `wireOIDC01Validate`
hslatman Jan 16, 2024
7680da7
Add realistic OIDC payload to Wire integration test
hslatman Jan 16, 2024
31bba6f
Merge branch 'wire-acme-extensions' into herman/remove-rusty-cli
hslatman Jan 16, 2024
17578b5
Merge pull request #1673 from smallstep/herman/wire-template-transform
hslatman Jan 16, 2024
0f0f060
Improve access and dpop token validation
hslatman Jan 16, 2024
0a7fe6e
Comment DPoP token checks that fail e2e test (currently)
hslatman Jan 16, 2024
b925474
Fix validations for DPoP client ID, nonce and issuer
hslatman Jan 17, 2024
f221232
Fix ACME `Validate` test for Wire DPoP challenge
hslatman Jan 17, 2024
f150a4f
Remove `sync.Once` for Wire configuration validation
hslatman Jan 17, 2024
36e14de
Improve Wire persistence errors
hslatman Jan 17, 2024
2f3819a
Use key authorization from ID token and `handle` -> `preferred_username`
hslatman Jan 17, 2024
19dbd02
Add audience validation to access, dpop and id token
hslatman Jan 17, 2024
51d1270
Merge pull request #1681 from smallstep/herman/fix-wire-extensions
hslatman Jan 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions acme/api/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (n *NewOrderRequest) Validate() error {
if err != nil {
return acme.WrapError(acme.ErrorMalformedType, err, "failed parsing Wire ID")
}
if _, err = wire.ParseClientID(wireID.ClientID); err != nil {
if _, err := wire.ParseClientID(wireID.ClientID); err != nil {
return acme.WrapError(acme.ErrorMalformedType, err, "invalid Wire client ID %q", wireID.ClientID)
}
default:
Expand Down Expand Up @@ -282,18 +282,21 @@ func newAuthorization(ctx context.Context, az *acme.Authorization) error {
if err != nil {
return acme.WrapError(acme.ErrorMalformedType, err, "failed parsing ClientID")
}

var targetProvider interface{ GetTarget(string) (string, error) }
wireOptions, err := prov.GetOptions().GetWireOptions()
if err != nil {
return acme.WrapErrorISE(err, "failed getting Wire options")
}
var targetProvider interface{ EvaluateTarget(string) (string, error) }
switch typ {
case acme.WIREOIDC01:
targetProvider = prov.GetOptions().GetOIDCOptions()
targetProvider = wireOptions.GetOIDCOptions()
case acme.WIREDPOP01:
targetProvider = prov.GetOptions().GetDPOPOptions()
targetProvider = wireOptions.GetDPOPOptions()
default:
return acme.NewError(acme.ErrorMalformedType, "unsupported type %q", typ)
}

target, err = targetProvider.GetTarget(clientID.DeviceID)
target, err = targetProvider.EvaluateTarget(clientID.DeviceID)
if err != nil {
return acme.WrapError(acme.ErrorMalformedType, err, "invalid Go template registered for 'target'")
}
Expand Down
49 changes: 28 additions & 21 deletions acme/api/order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/smallstep/certificates/acme"
"github.com/smallstep/certificates/authority/policy"
"github.com/smallstep/certificates/authority/provisioner"
"github.com/smallstep/certificates/authority/provisioner/wire"
)

func TestNewOrderRequest_Validate(t *testing.T) {
Expand Down Expand Up @@ -884,6 +885,10 @@ func TestHandler_NewOrder(t *testing.T) {
u := fmt.Sprintf("%s/acme/%s/order/ordID",
baseURL.String(), escProvName)

fakeWireSigningKey := `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEA5c+4NKZSNQcR1T8qN6SjwgdPZQ0Ge12Ylx/YeGAJ35k=
-----END PUBLIC KEY-----`

type test struct {
ca acme.CertificateAuthority
db acme.DB
Expand Down Expand Up @@ -1716,27 +1721,29 @@ func TestHandler_NewOrder(t *testing.T) {
},
"ok/default-naf-nbf-wireapp": func(t *testing.T) test {
acmeWireProv := newWireProvisionerWithOptions(t, &provisioner.Options{
OIDC: &provisioner.OIDCOptions{
Provider: provisioner.ProviderJSON{
IssuerURL: "",
AuthURL: "",
TokenURL: "",
JWKSURL: "",
UserInfoURL: "",
Algorithms: []string{},
},
Config: provisioner.ConfigJSON{
ClientID: "integration test",
SupportedSigningAlgs: []string{},
SkipClientIDCheck: true,
SkipExpiryCheck: true,
SkipIssuerCheck: true,
InsecureSkipSignatureCheck: true,
Now: time.Now,
},
},
DPOP: &provisioner.DPOPOptions{
ValidationExecPath: "true", // true will always exit with code 0
Wire: &wire.Options{
OIDC: &wire.OIDCOptions{
Provider: &wire.Provider{
IssuerURL: "https://issuer.example.com",
AuthURL: "",
TokenURL: "",
JWKSURL: "",
UserInfoURL: "",
Algorithms: []string{"ES256"},
},
Config: &wire.Config{
ClientID: "integration test",
SignatureAlgorithms: []string{"ES256"},
SkipClientIDCheck: true,
SkipExpiryCheck: true,
SkipIssuerCheck: true,
InsecureSkipSignatureCheck: true,
Now: time.Now,
},
},
DPOP: &wire.DPOPOptions{
SigningKey: []byte(fakeWireSigningKey),
},
},
})
acc := &acme.Account{ID: "accID"}
Expand Down
Loading
Loading