Skip to content

Commit

Permalink
Merge branch 'hdonCr/allow-multiple-audiences' of https://github.com/…
Browse files Browse the repository at this point in the history
…hdonCr/jwt into hdonCr/allow-multiple-audiences
  • Loading branch information
hdonCr committed Jan 28, 2025
2 parents ca1d34c + f1c5576 commit e107f51
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ func (m MyCustomClaims) Validate() error {

func Test_Validator_Validate(t *testing.T) {
type fields struct {
leeway time.Duration
timeFunc func() time.Time
verifyIat bool
expectedAud string
expectedIss string
expectedSub string
leeway time.Duration
timeFunc func() time.Time
verifyIat bool
expectedAud string
expectedAuds []string
expectedAudsMatchAll bool
expectedIss string
expectedSub string
}
type args struct {
claims Claims
Expand Down Expand Up @@ -72,12 +74,14 @@ func Test_Validator_Validate(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
v := &Validator{
leeway: tt.fields.leeway,
timeFunc: tt.fields.timeFunc,
verifyIat: tt.fields.verifyIat,
expectedAud: tt.fields.expectedAud,
expectedIss: tt.fields.expectedIss,
expectedSub: tt.fields.expectedSub,
leeway: tt.fields.leeway,
timeFunc: tt.fields.timeFunc,
verifyIat: tt.fields.verifyIat,
expectedAud: tt.fields.expectedAud,
expectedAuds: tt.fields.expectedAuds,
expectedAudsMatchAll: tt.fields.expectedAudsMatchAll,
expectedIss: tt.fields.expectedIss,
expectedSub: tt.fields.expectedSub,
}
if err := v.Validate(tt.args.claims); (err != nil) && !errors.Is(err, tt.wantErr) {
t.Errorf("validator.Validate() error = %v, wantErr %v", err, tt.wantErr)
Expand Down

0 comments on commit e107f51

Please sign in to comment.