|
1 | 1 | --- |
2 | 2 | suite: Testing issuers template with invalid values |
3 | 3 | templates: |
4 | | -- issuer.yaml |
| 4 | + - issuer.yaml |
5 | 5 | tests: |
6 | | -- it: Should trigger error when issuer doesn't have application consumerKey reference |
7 | | - values: |
8 | | - - values/invalid_issuers/application-ref-without-consumer.yaml |
9 | | - asserts: |
10 | | - - failedTemplate: |
11 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, 'applicationConsumerKeyRef', 'applicationKeyRef' and 'applicationSecretRef' need to be provided." |
12 | | - |
13 | | -- it: Should trigger error when issuer doesn't have application consumerKey reference key |
14 | | - values: |
15 | | - - values/invalid_issuers/application-ref-without-consumer-key.yaml |
16 | | - asserts: |
17 | | - - failedTemplate: |
18 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationConsumerKeyRef.name' and 'ovhAuthenticationRef.applicationConsumerKeyRef.key'" |
19 | | - |
20 | | -- it: Should trigger error when issuer doesn't have application consumerKey reference name |
21 | | - values: |
22 | | - - ./values/invalid_issuers/application-ref-without-consumer-name.yaml |
23 | | - asserts: |
24 | | - - failedTemplate: |
25 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationConsumerKeyRef.name' and 'ovhAuthenticationRef.applicationConsumerKeyRef.key'" |
26 | | - |
27 | | -- it: Should trigger error when issuer doesn't have application key reference |
28 | | - values: |
29 | | - - ./values/invalid_issuers/application-ref-without-key.yaml |
30 | | - asserts: |
31 | | - - failedTemplate: |
32 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, 'applicationConsumerKeyRef', 'applicationKeyRef' and 'applicationSecretRef' need to be provided." |
33 | | - |
34 | | -- it: Should trigger error when issuer doesn't have application key reference key |
35 | | - values: |
36 | | - - ./values/invalid_issuers/application-ref-without-key-key.yaml |
37 | | - asserts: |
38 | | - - failedTemplate: |
39 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationKeyRef.name' and 'ovhAuthenticationRef.applicationKeyRef.key'" |
40 | | - |
41 | | -- it: Should trigger error when issuer doesn't have application key reference name |
42 | | - values: |
43 | | - - ./values/invalid_issuers/application-ref-without-key-name.yaml |
44 | | - asserts: |
45 | | - - failedTemplate: |
46 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationKeyRef.name' and 'ovhAuthenticationRef.applicationKeyRef.key'" |
47 | | - |
48 | | -- it: Should trigger error when issuer doesn't have application secret reference |
49 | | - values: |
50 | | - - ./values/invalid_issuers/application-ref-without-secret.yaml |
51 | | - asserts: |
52 | | - - failedTemplate: |
53 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, 'applicationConsumerKeyRef', 'applicationKeyRef' and 'applicationSecretRef' need to be provided." |
54 | | - |
55 | | -- it: Should trigger error when issuer doesn't have application secret reference key |
56 | | - values: |
57 | | - - ./values/invalid_issuers/application-ref-without-secret-key.yaml |
58 | | - asserts: |
59 | | - - failedTemplate: |
60 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationSecretRef.name' and 'ovhAuthenticationRef.applicationSecretRef.key'" |
61 | | - |
62 | | -- it: Should trigger error when issuer doesn't have application secret reference name |
63 | | - values: |
64 | | - - ./values/invalid_issuers/application-ref-without-secret-name.yaml |
65 | | - asserts: |
66 | | - - failedTemplate: |
67 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationSecretRef.name' and 'ovhAuthenticationRef.applicationSecretRef.key'" |
68 | | - |
69 | | -- it: Should trigger error when issuer use both ovhAuthenticationRef and ovhAuthentication |
70 | | - values: |
71 | | - - ./values/invalid_issuers/both-auth-values-and-ref.yaml |
72 | | - asserts: |
73 | | - - failedTemplate: |
74 | | - errorMessage: "Invalid issuer both-auth-values-and-ref: For each issuer you wish to create, you need to define either 'ovhAuthentication' or 'ovhAuthenticationRef'" |
75 | | - |
76 | | -- it: Should trigger error when issuer doesn't have oauth2 clientID reference |
77 | | - values: |
78 | | - - ./values/invalid_issuers/oauth2-ref-without-client-id.yaml |
79 | | - asserts: |
80 | | - - failedTemplate: |
81 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, 'oauth2ClientIDRef' and 'oauth2ClientSecretRef' need to be provided." |
82 | | - |
83 | | -- it: Should trigger error when issuer doesn't have oauth2 clientID reference key |
84 | | - values: |
85 | | - - ./values/invalid_issuers/oauth2-ref-without-client-id-key.yaml |
86 | | - asserts: |
87 | | - - failedTemplate: |
88 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.oauth2ClientIDRef.name' and 'ovhAuthenticationRef.oauth2ClientIDRef.key'" |
89 | | - |
90 | | -- it: Should trigger error when issuer doesn't have oauth2 clientID reference name |
91 | | - values: |
92 | | - - ./values/invalid_issuers/oauth2-ref-without-client-id-name.yaml |
93 | | - asserts: |
94 | | - - failedTemplate: |
95 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.oauth2ClientIDRef.name' and 'ovhAuthenticationRef.oauth2ClientIDRef.key'" |
96 | | - |
97 | | -- it: Should trigger error when issuer doesn't have oauth2 clientSecret reference |
98 | | - values: |
99 | | - - ./values/invalid_issuers/oauth2-ref-without-client-secret.yaml |
100 | | - asserts: |
101 | | - - failedTemplate: |
102 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, 'oauth2ClientIDRef' and 'oauth2ClientSecretRef' need to be provided." |
103 | | - |
104 | | -- it: Should trigger error when issuer doesn't have oauth2 clientSecret reference key |
105 | | - values: |
106 | | - - ./values/invalid_issuers/oauth2-ref-without-client-secret-key.yaml |
107 | | - asserts: |
108 | | - - failedTemplate: |
109 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.oauth2ClientSecretRef.name' and 'ovhAuthenticationRef.oauth2ClientSecretRef.key'" |
110 | | - |
111 | | -- it: Should trigger error when issuer doesn't have oauth2 clientSecret reference name |
112 | | - values: |
113 | | - - ./values/invalid_issuers/oauth2-ref-without-client-secret-name.yaml |
114 | | - asserts: |
115 | | - - failedTemplate: |
116 | | - errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.oauth2ClientSecretRef.name' and 'ovhAuthenticationRef.oauth2ClientSecretRef.key'" |
117 | | - |
118 | | -- it: Should trigger error when issuer use not available authentication method |
119 | | - values: |
120 | | - - ./values/invalid_issuers/wrong-authentication-method.yaml |
121 | | - asserts: |
122 | | - - failedTemplate: |
123 | | - errorMessage: "Invalid issuer wrong-authentication-method: 'ovhAuthenticationMethod' is invalid. Allowed values are: application, oauth2" |
| 6 | + - it: Should trigger error when issuer doesn't have application consumerKey reference |
| 7 | + values: |
| 8 | + - values/invalid_issuers/application-ref-without-consumer.yaml |
| 9 | + asserts: |
| 10 | + - failedTemplate: |
| 11 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, 'applicationConsumerKeyRef', 'applicationKeyRef' and 'applicationSecretRef' need to be provided." |
| 12 | + |
| 13 | + - it: Should trigger error when issuer doesn't have application consumerKey reference key |
| 14 | + values: |
| 15 | + - values/invalid_issuers/application-ref-without-consumer-key.yaml |
| 16 | + asserts: |
| 17 | + - failedTemplate: |
| 18 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationConsumerKeyRef.name' and 'ovhAuthenticationRef.applicationConsumerKeyRef.key'" |
| 19 | + |
| 20 | + - it: Should trigger error when issuer doesn't have application consumerKey reference name |
| 21 | + values: |
| 22 | + - ./values/invalid_issuers/application-ref-without-consumer-name.yaml |
| 23 | + asserts: |
| 24 | + - failedTemplate: |
| 25 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationConsumerKeyRef.name' and 'ovhAuthenticationRef.applicationConsumerKeyRef.key'" |
| 26 | + |
| 27 | + - it: Should trigger error when issuer doesn't have application key reference |
| 28 | + values: |
| 29 | + - ./values/invalid_issuers/application-ref-without-key.yaml |
| 30 | + asserts: |
| 31 | + - failedTemplate: |
| 32 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, 'applicationConsumerKeyRef', 'applicationKeyRef' and 'applicationSecretRef' need to be provided." |
| 33 | + |
| 34 | + - it: Should trigger error when issuer doesn't have application key reference key |
| 35 | + values: |
| 36 | + - ./values/invalid_issuers/application-ref-without-key-key.yaml |
| 37 | + asserts: |
| 38 | + - failedTemplate: |
| 39 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationKeyRef.name' and 'ovhAuthenticationRef.applicationKeyRef.key'" |
| 40 | + |
| 41 | + - it: Should trigger error when issuer doesn't have application key reference name |
| 42 | + values: |
| 43 | + - ./values/invalid_issuers/application-ref-without-key-name.yaml |
| 44 | + asserts: |
| 45 | + - failedTemplate: |
| 46 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationKeyRef.name' and 'ovhAuthenticationRef.applicationKeyRef.key'" |
| 47 | + |
| 48 | + - it: Should trigger error when issuer doesn't have application secret reference |
| 49 | + values: |
| 50 | + - ./values/invalid_issuers/application-ref-without-secret.yaml |
| 51 | + asserts: |
| 52 | + - failedTemplate: |
| 53 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, 'applicationConsumerKeyRef', 'applicationKeyRef' and 'applicationSecretRef' need to be provided." |
| 54 | + |
| 55 | + - it: Should trigger error when issuer doesn't have application secret reference key |
| 56 | + values: |
| 57 | + - ./values/invalid_issuers/application-ref-without-secret-key.yaml |
| 58 | + asserts: |
| 59 | + - failedTemplate: |
| 60 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationSecretRef.name' and 'ovhAuthenticationRef.applicationSecretRef.key'" |
| 61 | + |
| 62 | + - it: Should trigger error when issuer doesn't have application secret reference name |
| 63 | + values: |
| 64 | + - ./values/invalid_issuers/application-ref-without-secret-name.yaml |
| 65 | + asserts: |
| 66 | + - failedTemplate: |
| 67 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.applicationSecretRef.name' and 'ovhAuthenticationRef.applicationSecretRef.key'" |
| 68 | + |
| 69 | + - it: Should trigger error when issuer use both ovhAuthenticationRef and ovhAuthentication |
| 70 | + values: |
| 71 | + - ./values/invalid_issuers/both-auth-values-and-ref.yaml |
| 72 | + asserts: |
| 73 | + - failedTemplate: |
| 74 | + errorMessage: "Invalid issuer both-auth-values-and-ref: For each issuer you wish to create, you need to define either 'ovhAuthentication' or 'ovhAuthenticationRef'" |
| 75 | + |
| 76 | + - it: Should trigger error when issuer doesn't have oauth2 clientID reference |
| 77 | + values: |
| 78 | + - ./values/invalid_issuers/oauth2-ref-without-client-id.yaml |
| 79 | + asserts: |
| 80 | + - failedTemplate: |
| 81 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, 'oauth2ClientIDRef' and 'oauth2ClientSecretRef' need to be provided." |
| 82 | + |
| 83 | + - it: Should trigger error when issuer doesn't have oauth2 clientID reference key |
| 84 | + values: |
| 85 | + - ./values/invalid_issuers/oauth2-ref-without-client-id-key.yaml |
| 86 | + asserts: |
| 87 | + - failedTemplate: |
| 88 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.oauth2ClientIDRef.name' and 'ovhAuthenticationRef.oauth2ClientIDRef.key'" |
| 89 | + |
| 90 | + - it: Should trigger error when issuer doesn't have oauth2 clientID reference name |
| 91 | + values: |
| 92 | + - ./values/invalid_issuers/oauth2-ref-without-client-id-name.yaml |
| 93 | + asserts: |
| 94 | + - failedTemplate: |
| 95 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.oauth2ClientIDRef.name' and 'ovhAuthenticationRef.oauth2ClientIDRef.key'" |
| 96 | + |
| 97 | + - it: Should trigger error when issuer doesn't have oauth2 clientSecret reference |
| 98 | + values: |
| 99 | + - ./values/invalid_issuers/oauth2-ref-without-client-secret.yaml |
| 100 | + asserts: |
| 101 | + - failedTemplate: |
| 102 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, 'oauth2ClientIDRef' and 'oauth2ClientSecretRef' need to be provided." |
| 103 | + |
| 104 | + - it: Should trigger error when issuer doesn't have oauth2 clientSecret reference key |
| 105 | + values: |
| 106 | + - ./values/invalid_issuers/oauth2-ref-without-client-secret-key.yaml |
| 107 | + asserts: |
| 108 | + - failedTemplate: |
| 109 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.oauth2ClientSecretRef.name' and 'ovhAuthenticationRef.oauth2ClientSecretRef.key'" |
| 110 | + |
| 111 | + - it: Should trigger error when issuer doesn't have oauth2 clientSecret reference name |
| 112 | + values: |
| 113 | + - ./values/invalid_issuers/oauth2-ref-without-client-secret-name.yaml |
| 114 | + asserts: |
| 115 | + - failedTemplate: |
| 116 | + errorMessage: "Error: When 'ovhAuthenticationRef' is used, you need to provide 'ovhAuthenticationRef.oauth2ClientSecretRef.name' and 'ovhAuthenticationRef.oauth2ClientSecretRef.key'" |
| 117 | + |
| 118 | + - it: Should trigger error when issuer use not available authentication method |
| 119 | + values: |
| 120 | + - ./values/invalid_issuers/wrong-authentication-method.yaml |
| 121 | + asserts: |
| 122 | + - failedTemplate: |
| 123 | + errorMessage: "Invalid issuer wrong-authentication-method: 'ovhAuthenticationMethod' is invalid. Allowed values are: application, oauth2" |
0 commit comments