Repository navigation
v0.10.1 - Token client fixes and CI hardening
This release fixes a series of defects in the token clients and in the bucket and Knowledge Graph functions found in a review of the toolbox, makes the client that carries EBRAINS_TOKEN say what is wrong when that token expires, and tightens the CI workflows. No public functions, classes, or name-value options are added or removed.
Fixed
- Refreshing a token that came without a refresh token, as one given through
EBRAINS_TOKENdoes, ran the device-flow login and then a second, redundant refresh request that discarded the token just obtained. A failure of that second request was shown as "Token Refresh Failed" although the login had succeeded (#30). createVirtualBucketcreated every object without a file extension, such asREADMEorLICENSE, as a directory, and a laterdownloadFileinto that path was refused. An entry is now a folder only where the bucket says so: a name ending in/, or a directory content type (#30).authenticatehanded the OIDC client id and secret to the token client in the field order of its options struct, so naming the secret before the id would have logged in with the secret as the client id. Both are passed by name now. Giving only one of the two raisesEBRAINS:authenticate:IncompleteCredentialsinstead of authenticating with an empty id or secret (#30).getInstancesBulktook the identifier of a missing instance from the message of the server's error, which names the id for a miss but explains itself for anything else, so a permission error became an "identifier" that was looked up in the next stage and finally reported as a missing instance. Missing ids are now the requested ids the response did not answer, and an id the response leaves out entirely counts as missing where it used to be dropped (#30).decode_jwtread the token payload throughjavax.xml.bind.DatatypeConverter, which needs a running JVM and was removed from the JDK in Java 11. It usesmatlab.net.base64decode(#30), and a live test decodes a real EBRAINS token to confirm it (#31).- An expired
EBRAINS_TOKENfailed with "Invalid client credentials. Please verify your client ID and secret." The client that carries such a token has no credentials of its own and tried to renew with empty ones. It now raisesEBRAINS:IAM:MissingClientCredentialsbefore any request, saying that a token fromEBRAINS_TOKENcannot be renewed by the toolbox, or, when there was no token at all, which options supply the credentials. Code that caught theMATLAB:webservices:HTTP400StatusCodeErrorof the old behaviour should catch the new identifier (#32). - Logging in with the client credentials flow after any API call warned
EBRAINS:IAM:CredentialsChanged, because the credential-less client thatgetTokenManagercreates on the way held empty credentials. A first login is no longer reported as a change of credentials; a change between two real sets still is (#32). - Requests to the identity provider used the 5-second
weboptionsdefault timeout, which a slow connection could exceed at login. They now allow 10 seconds (#34).
Changed
OidcTokenClientstores a token together with its expiry throughstoreToken,storeRefreshToken, andclearRefreshToken, so the two cannot drift apart. The token properties behind them are private; a subclass that assigned them directly should call those protected methods instead (#33).HttpClient.getDefaultHeadertakes the ready Authorization field fromgetAuthHeaderFieldinstead of building one from the raw token, so the toolbox itself no longer reads the token value. The publicAccessTokenproperty is unchanged (#35).- The client secret of the live integration tests reaches MATLAB through the environment instead of being expanded into the command;
test-code.yml,run-codespell.yml, andlive-integration-tests.ymldeclare the token permissions they need instead of inheriting the repository default; and the test workflow runs on changes to.github, which it used to skip (#32).
Full Changelog: v0.10.0...v0.10.1