Skip to content

Commit

Permalink
client auth tests
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-elliott committed Sep 28, 2024
1 parent 95370b6 commit d31ada4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ type RequestedAudienceImplicitClient interface {
type IntrospectionJWTResponseClient interface {
// GetIntrospectionSignedResponseKeyID returns the specific key identifier used to satisfy JWS requirements for
// OAuth 2.0 JWT introspection response specifications. If unspecified the other available parameters will be
// // utilized to select an appropriate key.
// utilized to select an appropriate key.
GetIntrospectionSignedResponseKeyID() (kid string)

// GetIntrospectionSignedResponseAlg is equivalent to the 'introspection_signed_response_alg' client metadata
Expand All @@ -405,7 +405,7 @@ type IntrospectionJWTResponseClient interface {

// GetIntrospectionEncryptedResponseKeyID returns the specific key identifier used to satisfy JWE requirements for
// OAuth 2.0 JWT introspection response specifications. If unspecified the other available parameters will be
// // utilized to select an appropriate key.
// utilized to select an appropriate key.
GetIntrospectionEncryptedResponseKeyID() (kid string)

// GetIntrospectionEncryptedResponseAlg is equivalent to the 'introspection_encrypted_response_alg' client metadata
Expand Down
9 changes: 6 additions & 3 deletions token/jwt/claims_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"authelia.com/provider/oauth2/internal/consts"
)
Expand Down Expand Up @@ -143,7 +144,7 @@ func TestMapClaims_VerifyAudienceAll(t *testing.T) {
true,
},
{
"ShouldFailMultipleAny",
"ShouldFailMultipleAll",
MapClaims{
consts.ClaimAudience: []string{"foo"},
},
Expand Down Expand Up @@ -273,7 +274,7 @@ func TestMapClaims_VerifyAudienceAny(t *testing.T) {
true,
},
{
"ShouldFailMultipleAny",
"ShouldPassMultipleAny",
MapClaims{
consts.ClaimAudience: []string{"foo"},
},
Expand Down Expand Up @@ -864,7 +865,7 @@ func TestMapClaims_Valid(t *testing.T) {
{
"ShouldFailEXPNotPresent",
MapClaims{},
[]ClaimValidationOption{ValidateRequireExpiresAt()},
[]ClaimValidationOption{ValidateRequireExpiresAt(), ValidateTimeFunc(func() time.Time { return time.Unix(0, 0) })},
[]uint32{ValidationErrorExpired},
"Token is expired",
},
Expand Down Expand Up @@ -995,6 +996,8 @@ func TestMapClaims_Valid(t *testing.T) {

errors.As(actual, &e)

require.NotNil(t, e)

var errs uint32

for _, err := range tc.errs {
Expand Down
4 changes: 2 additions & 2 deletions token/jwt/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func (r *decoratedJWTProfileAccessTokenClient) IsClientSigned() (is bool) {
type IntrospectionClient interface {
// GetIntrospectionSignedResponseKeyID returns the specific key identifier used to satisfy JWS requirements for
// OAuth 2.0 JWT introspection response specifications. If unspecified the other available parameters will be
// // utilized to select an appropriate key.
// utilized to select an appropriate key.
GetIntrospectionSignedResponseKeyID() (kid string)

// GetIntrospectionSignedResponseAlg is equivalent to the 'introspection_signed_response_alg' client metadata
Expand All @@ -431,7 +431,7 @@ type IntrospectionClient interface {

// GetIntrospectionEncryptedResponseKeyID returns the specific key identifier used to satisfy JWE requirements for
// OAuth 2.0 JWT introspection response specifications. If unspecified the other available parameters will be
// // utilized to select an appropriate key.
// utilized to select an appropriate key.
GetIntrospectionEncryptedResponseKeyID() (kid string)

// GetIntrospectionEncryptedResponseAlg is equivalent to the 'introspection_encrypted_response_alg' client metadata
Expand Down

0 comments on commit d31ada4

Please sign in to comment.