Minor fixes and tweak for Cloud APIs. (#8557)

- Fix secret to at least be working again
- Tweak to allow a MIMIC flow to work with value types (revisit in 2024).
This commit is contained in:
James Dunkerley 2023-12-15 17:10:07 +00:00 committed by GitHub
parent 9d27edafce
commit 9e27b6487b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -2734,6 +2734,11 @@ Text.from (that : Table) (format:Delimited_Format = Delimited_Format.Delimited '
Conversion method to a Table from a Vector. Conversion method to a Table from a Vector.
Table.from (that:Vector) (fields : (Vector | Nothing) = Nothing) = that.to_table fields Table.from (that:Vector) (fields : (Vector | Nothing) = Nothing) = that.to_table fields
## PRIVATE
Conversion method to a Table from a JS_Object.
Table.from (that:JS_Object) (fields : (Vector | Nothing) = Nothing) =
Table.from_objects that fields
## PRIVATE ## PRIVATE
Convert an `XML_Element` into a `Table` Convert an `XML_Element` into a `Table`

View File

@ -277,6 +277,8 @@ type Value_Type
_ -> False _ -> False
Value_Type.Char self_size self_variable_length -> case target_type of Value_Type.Char self_size self_variable_length -> case target_type of
Value_Type.Char target_size target_variable_length -> Value_Type.Char target_size target_variable_length ->
## If the source is variable_length, lets try and load it and warn about truncation.
if self_variable_length then True else
fits_variability = if target_variable_length then True else self_variable_length == target_variable_length fits_variability = if target_variable_length then True else self_variable_length == target_variable_length
fits_variability && (target_size >= self_size) fits_variability && (target_size >= self_size)
_ -> False _ -> False

View File

@ -27,7 +27,7 @@ class EnsoSecretReader {
return secrets.get(secretId); return secrets.get(secretId);
} }
var apiUri = AuthenticationProvider.getAPIRootURI() + "/secrets/" + secretId; var apiUri = AuthenticationProvider.getAPIRootURI() + "/s3cr3tz/" + secretId;
var client = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.ALWAYS).build(); var client = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.ALWAYS).build();
var request = var request =
HttpRequest.newBuilder() HttpRequest.newBuilder()
@ -55,6 +55,8 @@ class EnsoSecretReader {
} }
private static String readValueFromString(String json) { private static String readValueFromString(String json) {
return json.substring(1, json.length() - 1).translateEscapes(); var base64 = json.substring(1, json.length() - 1).translateEscapes();
return new String(
java.util.Base64.getDecoder().decode(base64), java.nio.charset.StandardCharsets.UTF_8);
} }
} }