Hi all, cli is very usable now, great work <@U02UC...
# help-api-cli-orchestration
h
Hi all, cli is very usable now, great work @Augustin Lafanechere (Airbyte) ! I am having trouble migrating embedded service credentials to ~/.octavia env file. What is the proper way of doing it regarding multiline eg gcp service json keys? Is it just base64 encoding the contents of the json file? Some example in the docs would be nice
a
Hi @Hrvoje Piasevoli, did you finally manage to use multiline env var? I did not implement anything specifically to use multiline env var and there's no builtin base64 decoding. Feel free to create an issue and share its link here if you did not succeeded in using multiline env var.
h
Thanks for replying @Augustin Lafanechere (Airbyte). I have given it some more thought and came to the conclusion that this would not be ideal. Better approach would be to be able to specify a path to the credentials file, but this would then require parsing some new project file that specifies the local paths to the secret keys that need to be dynamically mounted as docker volumes. And then there is the problem of ingesting this multiline data in the configuration yaml and this is not variable expansion. So, I think I'll just replace the secret parts with a couple of variables per credentials_json and live with it. Btw, what do you feel about a command to preview the contents with variable expansions applied. Something like "render" or "compile" eg: octavia render --file sources/my_source_with_secrets/configuration.yaml > source_with_vars_expanded.yaml ?
a
Yes I like this "render" suggestion, feel free to open an issue to suggest it and we'll work on this asap
h
Getting back to this thread - it seems that the problem is with credentials_json - the whole value gets replaced by a "secret" eg:
Copy code
{
  "view_id": "123456",
  "start_date": "2020-06-01",
  "credentials": {
    "auth_type": "Service",
    "credentials_json": {
      "_secret": "airbyte_workspace_cd04bdec-8ea9-4abc-be46-9d415ae3d32a_secret_c4f87b87-2d4c-4b39-b797-3f8d59dad259_v11"
    }
  },
  "window_in_days": 1
}
But the secrets values have not been expanded using env variables when you look at the database secrets.payload for coordinate airbyte_workspace_cd04bdec-8ea9-4abc-be46-9d415ae3d32a_secret_c4f87b87-2d4c-4b39-b797-3f8d59dad259_v11
Copy code
{
  "type": "service_account",
  "project_id": "myproject",
  "private_key_id": ${SRC_PRIVATE_KEY_ID},
  "private_key": ${SRC_PRIVATE_KEY},
  "client_email": "<mailto:my@myproject.iam.gserviceaccount.com|my@myproject.iam.gserviceaccount.com>",
  "client_id": "123456",
  "auth_uri": "<https://accounts.google.com/o/oauth2/auth>",
  "token_uri": "<https://oauth2.googleapis.com/token>",
  "auth_provider_x509_cert_url": "<https://www.googleapis.com/oauth2/v1/certs>",
  "client_x509_cert_url": "<https://www.googleapis.com/robot/v1/metadata/x509/my%40myproject.iam.gserviceaccount.com>"
}