Commit bf926fb
fix(gdch): support EC private keys (#1896)
* fix: allow for ES algorithm in GdchCredentials
* test: partially adapt tests
* test: finish adjusting tests
* chore: format
* fix: restore credential name
* docs: restore license
* fix: restore removed code
* test: increase coverage
* test(gdch): parameterize test
* test: remove unused var
* chore: remove unused throw clause
* test: parameterize more
* fix: remove unused parameter
* fix: make variables final as intended
* fix: remove unused throw clause
* fix: remove unused throw clause
* fix: make OAuth2Credentials clock package private for production code
* fix: use non deprecated base 64 encoder
* test: parameterize flagged tests
* chore: format
* test: fix assertion
* build: remove unused dependency
* test: run linux gce only on linux envs
* fix: sonarqube flags (use java.util.Base64)
* fix: improve error message template
* fix: keep overload of "with audience" that takes an URI
* fix: restore public getter of getApiAudience
* docs: add javadoc for signing logic
* test: test private signature and decode methods
* fix: add null and empty check for audience string
* docs: add javadoc for audience getters
* fix: use enum for possible algorithms
* fix: use obsolete javadoc instead of @deprecated
* refactor: use OAuth2Utils validate methods in GdchCredentials
* fix: restore GoogleAuthException throwing in GdchCredentials
* refactor: downgrade Pkcs8Algorithm and privateKeyFromPkcs8 to package-private
* refactor: split parseBody into parseJson and parseQuery in test utilities
* refactor: remove validation reflection by making signUsingEsSha256 package-private
* test: use hardcoded string literal for gdch api audience in test
* test: refactor to use assertThrows in GdchCredentialsTest and remove host OS check in DefaultCredentialsProviderTest
* fix: add comment about EC algorithm support in GdchCredentials
* fix: update GDCH audience error message to be more descriptive
* refactor: rename getApiAudienceString to getGdchAudience
* fix: Remove unused import
* docs: update GDCH audience getter javadocs
* test: add null-checks to builder and corresponding tests
* refactor: consolidate token type constants using OAuth2Utils
* refactor: throw GoogleAuthException for signing and transcoding errors
* docs: add javadoc to related test utils
* fix: use GoogleAuthException
* test: use assertThrows where applicable
* refactor: replace Preconditions with Strings.isNullOrEmpty for audience checks
* fix: consistent exception message
* chore: format
* test: use lowercase os name
* chore: address review comments for PR #1896
* chore: format
* Finalizing GDCH credentials support by addressing reviewer comments
* chore: format
* fix: parse EC private keys with SEC1 algorithm
* chore: format
* fix: separate PKCs8 vs SEC1 logic in GdchCredentials
* fix: improved exception message, added comments to extractPrivateKeyValue
Original-PR: googleapis/google-auth-library-java#18961 parent 40c9b0b commit bf926fb
File tree
8 files changed
+885
-103
lines changed- google-auth-library-java/oauth2_http
- javatests/com/google/auth
- oauth2
- java/com/google/auth/oauth2
8 files changed
+885
-103
lines changedLines changed: 375 additions & 36 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
269 | 273 | | |
270 | 274 | | |
271 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
272 | 294 | | |
273 | 295 | | |
274 | 296 | | |
| |||
278 | 300 | | |
279 | 301 | | |
280 | 302 | | |
281 | | - | |
| 303 | + | |
282 | 304 | | |
283 | 305 | | |
284 | 306 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
100 | 107 | | |
101 | 108 | | |
102 | 109 | | |
| |||
112 | 119 | | |
113 | 120 | | |
114 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
115 | 139 | | |
116 | 140 | | |
117 | 141 | | |
| |||
Lines changed: 15 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 169 | + | |
175 | 170 | | |
176 | 171 | | |
177 | 172 | | |
178 | 173 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 174 | + | |
186 | 175 | | |
187 | 176 | | |
188 | 177 | | |
189 | 178 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 179 | + | |
196 | 180 | | |
197 | 181 | | |
198 | 182 | | |
199 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
200 | 188 | | |
201 | | - | |
202 | | - | |
203 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
204 | 193 | | |
205 | | - | |
| 194 | + | |
206 | 195 | | |
207 | 196 | | |
208 | 197 | | |
| |||
359 | 348 | | |
360 | 349 | | |
361 | 350 | | |
362 | | - | |
| 351 | + | |
363 | 352 | | |
364 | 353 | | |
365 | 354 | | |
| |||
0 commit comments