@@ -85,6 +85,61 @@ func Test_defaultModelBuildTask_buildAuthenticateOIDCAction(t *testing.T) {
8585 },
8686 },
8787 },
88+ {
89+ name : "clientSecret has control characters at end" ,
90+ env : env {
91+ secrets : []* corev1.Secret {
92+ {
93+ ObjectMeta : metav1.ObjectMeta {
94+ Namespace : "my-ns" ,
95+ Name : "my-k8s-secret" ,
96+ },
97+ Data : map [string ][]byte {
98+ "clientID" : []byte ("my-client-id" ),
99+ "clientSecret" : []byte ("my-client-secret\n " ),
100+ },
101+ },
102+ },
103+ },
104+ args : args {
105+ authCfg : AuthConfig {
106+ Type : AuthTypeCognito ,
107+ IDPConfigOIDC : & AuthIDPConfigOIDC {
108+ Issuer : "https://example.com" ,
109+ AuthorizationEndpoint : "https://authorization.example.com" ,
110+ TokenEndpoint : "https://token.example.com" ,
111+ UserInfoEndpoint : "https://userinfo.example.co" ,
112+ SecretName : "my-k8s-secret" ,
113+ AuthenticationRequestExtraParams : map [string ]string {
114+ "key1" : "value1" ,
115+ },
116+ },
117+ OnUnauthenticatedRequest : "authenticate" ,
118+ Scope : "email" ,
119+ SessionCookieName : "my-session-cookie" ,
120+ SessionTimeout : 65536 ,
121+ },
122+ namespace : "my-ns" ,
123+ },
124+ want : elbv2model.Action {
125+ Type : elbv2model .ActionTypeAuthenticateOIDC ,
126+ AuthenticateOIDCConfig : & elbv2model.AuthenticateOIDCActionConfig {
127+ Issuer : "https://example.com" ,
128+ AuthorizationEndpoint : "https://authorization.example.com" ,
129+ TokenEndpoint : "https://token.example.com" ,
130+ UserInfoEndpoint : "https://userinfo.example.co" ,
131+ ClientID : "my-client-id" ,
132+ ClientSecret : "my-client-secret" ,
133+ AuthenticationRequestExtraParams : map [string ]string {
134+ "key1" : "value1" ,
135+ },
136+ OnUnauthenticatedRequest : authBehaviorAuthenticate ,
137+ Scope : awssdk .String ("email" ),
138+ SessionCookieName : awssdk .String ("my-session-cookie" ),
139+ SessionTimeout : awssdk .Int64 (65536 ),
140+ },
141+ },
142+ },
88143 {
89144 name : "clientID & clientSecret configured - legacy clientId" ,
90145 env : env {
0 commit comments