@@ -12,17 +12,17 @@ import (
1212 . "github.com/onsi/gomega"
1313 "k8s.io/utils/ptr"
1414
15- . "github.com/gardener/oidc-webhook-authenticator/apis/authentication/v1alpha1"
15+ authenticationv1alpha1 "github.com/gardener/oidc-webhook-authenticator/apis/authentication/v1alpha1"
1616)
1717
1818var _ = Describe ("OpenidconnectWebhook" , func () {
1919 var (
20- oidc OpenIDConnect
21- systemPrefix = SystemPrefix
20+ oidc authenticationv1alpha1. OpenIDConnect
21+ systemPrefix = authenticationv1alpha1 . SystemPrefix
2222 )
2323
2424 BeforeEach (func () {
25- oidc = OpenIDConnect {}
25+ oidc = authenticationv1alpha1. OpenIDConnect {}
2626 })
2727
2828 Context ("defaulting" , func () {
@@ -51,14 +51,14 @@ var _ = Describe("OpenidconnectWebhook", func() {
5151 It ("should default supported signing algs" , func () {
5252 oidc .Default ()
5353 Expect (len (oidc .Spec .SupportedSigningAlgs )).To (Equal (1 ))
54- Expect (oidc .Spec .SupportedSigningAlgs [0 ]).To (Equal (RS256 ))
54+ Expect (oidc .Spec .SupportedSigningAlgs [0 ]).To (Equal (authenticationv1alpha1 . RS256 ))
5555 })
5656
5757 It ("should not default supported signing algs if explicitly set" , func () {
58- oidc .Spec .SupportedSigningAlgs = []SigningAlgorithm {RS256 , RS512 }
58+ oidc .Spec .SupportedSigningAlgs = []authenticationv1alpha1. SigningAlgorithm {authenticationv1alpha1 . RS256 , authenticationv1alpha1 . RS512 }
5959 oidc .Default ()
6060 Expect (len (oidc .Spec .SupportedSigningAlgs )).To (Equal (2 ))
61- Expect (oidc .Spec .SupportedSigningAlgs ).To (ConsistOf (RS256 , RS512 ))
61+ Expect (oidc .Spec .SupportedSigningAlgs ).To (ConsistOf (authenticationv1alpha1 . RS256 , authenticationv1alpha1 . RS512 ))
6262 })
6363 })
6464
@@ -77,8 +77,8 @@ var _ = Describe("OpenidconnectWebhook", func() {
7777 })
7878
7979 It ("should return error for supported signing algorithms that are not allowed" , func () {
80- oidc .Spec .SupportedSigningAlgs = []SigningAlgorithm {
81- RS256 ,
80+ oidc .Spec .SupportedSigningAlgs = []authenticationv1alpha1. SigningAlgorithm {
81+ authenticationv1alpha1 . RS256 ,
8282 "deprecated1" ,
8383 "deprecated2" ,
8484 }
@@ -178,8 +178,8 @@ var _ = Describe("OpenidconnectWebhook", func() {
178178 })
179179
180180 It ("should not return error if new oidc object is valid" , func () {
181- newObj := OpenIDConnect {
182- Spec : OIDCAuthenticationSpec {
181+ newObj := authenticationv1alpha1. OpenIDConnect {
182+ Spec : authenticationv1alpha1. OIDCAuthenticationSpec {
183183 IssuerURL : "https://secure2.com" ,
184184 ClientID : "some-id" ,
185185 },
@@ -190,8 +190,8 @@ var _ = Describe("OpenidconnectWebhook", func() {
190190 })
191191
192192 It ("should return error if new oidc object is not valid" , func () {
193- newObj := OpenIDConnect {
194- Spec : OIDCAuthenticationSpec {
193+ newObj := authenticationv1alpha1. OpenIDConnect {
194+ Spec : authenticationv1alpha1. OIDCAuthenticationSpec {
195195 IssuerURL : "http://notsecure.com" ,
196196 ClientID : "some-id" ,
197197 },
@@ -205,8 +205,8 @@ var _ = Describe("OpenidconnectWebhook", func() {
205205 DescribeTable ("should not allow username prefix to start with 'system:'" ,
206206 func (maliciousPrefix string ) {
207207 errMessageTemplate := "usernamePrefix: Invalid value: \" %s\" : must not start with system:"
208- newObj := OpenIDConnect {
209- Spec : OIDCAuthenticationSpec {
208+ newObj := authenticationv1alpha1. OpenIDConnect {
209+ Spec : authenticationv1alpha1. OIDCAuthenticationSpec {
210210 IssuerURL : "https://secure2.com" ,
211211 ClientID : "some-id" ,
212212 UsernamePrefix : & maliciousPrefix ,
@@ -224,8 +224,8 @@ var _ = Describe("OpenidconnectWebhook", func() {
224224
225225 DescribeTable ("should allow username prefix if it does not start with 'system:'" ,
226226 func (validPrefix string ) {
227- newObj := OpenIDConnect {
228- Spec : OIDCAuthenticationSpec {
227+ newObj := authenticationv1alpha1. OpenIDConnect {
228+ Spec : authenticationv1alpha1. OIDCAuthenticationSpec {
229229 IssuerURL : "https://secure2.com" ,
230230 ClientID : "some-id" ,
231231 UsernamePrefix : & validPrefix ,
@@ -246,8 +246,8 @@ var _ = Describe("OpenidconnectWebhook", func() {
246246 DescribeTable ("should not allow groups prefix to start with 'system:'" ,
247247 func (maliciousPrefix string ) {
248248 errMessageTemplate := "groupsPrefix: Invalid value: \" %s\" : must not start with system:"
249- newObj := OpenIDConnect {
250- Spec : OIDCAuthenticationSpec {
249+ newObj := authenticationv1alpha1. OpenIDConnect {
250+ Spec : authenticationv1alpha1. OIDCAuthenticationSpec {
251251 IssuerURL : "https://secure2.com" ,
252252 ClientID : "some-id" ,
253253 GroupsPrefix : & maliciousPrefix ,
@@ -265,8 +265,8 @@ var _ = Describe("OpenidconnectWebhook", func() {
265265
266266 DescribeTable ("should allow groups prefix if it does not start with 'system:'" ,
267267 func (validPrefix string ) {
268- newObj := OpenIDConnect {
269- Spec : OIDCAuthenticationSpec {
268+ newObj := authenticationv1alpha1. OpenIDConnect {
269+ Spec : authenticationv1alpha1. OIDCAuthenticationSpec {
270270 IssuerURL : "https://secure2.com" ,
271271 ClientID : "some-id" ,
272272 GroupsPrefix : & validPrefix ,
0 commit comments