-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance(oidc): add more claims (#1172)
- Loading branch information
1 parent
d0fa4f7
commit b998ec1
Showing
5 changed files
with
105 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package token | ||
|
||
import "testing" | ||
|
||
func Test_imageParse(t *testing.T) { | ||
type args struct { | ||
image string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
wantName string | ||
wantTag string | ||
wantErr bool | ||
}{ | ||
{ | ||
name: "image with tag", | ||
args: args{ | ||
image: "alpine:1.20", | ||
}, | ||
wantName: "alpine", | ||
wantTag: "1.20", | ||
wantErr: false, | ||
}, | ||
{ | ||
name: "image without latest tag", | ||
args: args{ | ||
image: "alpine:latest", | ||
}, | ||
wantName: "alpine", | ||
wantTag: "latest", | ||
wantErr: false, | ||
}, | ||
{ | ||
name: "image without tag", | ||
args: args{ | ||
image: "alpine", | ||
}, | ||
wantName: "alpine", | ||
wantTag: "latest", | ||
wantErr: false, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
got, got1, err := imageParse(tt.args.image) | ||
if (err != nil) != tt.wantErr { | ||
t.Errorf("imageParse() error = %v, wantErr %v", err, tt.wantErr) | ||
return | ||
} | ||
if got != tt.wantName { | ||
t.Errorf("imageParse() got = %v, wantName %v", got, tt.wantName) | ||
} | ||
if got1 != tt.wantTag { | ||
t.Errorf("imageParse() got1 = %v, wantName %v", got1, tt.wantTag) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters