GoogleCloudPlatform / application-integration-management-toolkit

This tool lets you interact with Application Integration, Integration Connectors or Apigee Integration/Connector APIs. The tool lets you manage (create, del, get, list) integrations, connections etc.
Apache License 2.0
22 stars 16 forks source link

Access GOOGLE_CREDENTIALS for security key #140

Closed vmisra-roc closed 11 months ago

vmisra-roc commented 11 months ago

integrationCli should able to look at the GOOGLE_CREDENTIALS environment variable for security key when token has expired or not set.

ssvaidyanathan commented 11 months ago

@vmisra-roc - are you referring to GOOGLE_APPLICATION_CREDENTIALS that is used to set the path of the service account json?

srinandan commented 11 months ago

integrationcli supports service accounts through the use of the -a flag.

Full help for the flag: -a, --account string Path Service Account private key in JSON

You could use integrationcli -a $GOOGLE_APPLICATION_CREDENTIALS since the CLI does not look at the environment variable. We can add this as a feature in the future.

ssvaidyanathan commented 11 months ago

Thanks @srinandan

@vmisra-roc - You have 3 ways essentially

  1. integrationcli integrations list -a $GOOGLE_APPLICATION_CREDENTIALS >> just use it with your commands
  2. integrationcli token cache -a $GOOGLE_APPLICATION_CREDENTIALS >> caches the token from the SA and uses it subsequently. Then you can ignore the token to be passed in the subsequent calls as its cached
  3. TOKEN=$(integrationcli token gen -a $GOOGLE_APPLICATION_CREDENTIALS) >> and then use this in subsequent commands with the -t $TOKEN option
vmisra-roc commented 11 months ago

Thanks a lot folks. This was super useful.

On Thu, Oct 5, 2023 at 3:30 PM Sai Saran Vaidyanathan < @.***> wrote:

Thanks @srinandan https://urldefense.com/v3/__https://github.com/srinandan__;!!PYhZlW11KQ!At6a-mUZ2_0h3ZExu15CQVqpQZnojk9gKgGnmVeM4-utG23Vg0MTiJb4i_vP1Yi4F00k9hQv7WOuZ7Hu-VOeG8g$

@vmisra-roc https://urldefense.com/v3/__https://github.com/vmisra-roc__;!!PYhZlW11KQ!At6a-mUZ2_0h3ZExu15CQVqpQZnojk9gKgGnmVeM4-utG23Vg0MTiJb4i_vP1Yi4F00k9hQv7WOuZ7Hum6Mwb0A$

  • You have 3 ways essentially

    1. integrationcli integrations list -a $GOOGLE_APPLICATION_CREDENTIALS

      just use it with your commands

    2. integrationcli token cache -a $GOOGLE_APPLICATION_CREDENTIALS >> caches the token from the SA and uses it subsequently. Then you can ignore the token in the subsequent calls as its cached
    3. TOKEN=$(integrationcli token gen -a $GOOGLE_APPLICATION_CREDENTIALS)

      and then use this in subsequent commands with the -t $TOKEN option

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/GoogleCloudPlatform/application-integration-management-toolkit/issues/140*issuecomment-1749522135__;Iw!!PYhZlW11KQ!At6a-mUZ2_0h3ZExu15CQVqpQZnojk9gKgGnmVeM4-utG23Vg0MTiJb4i_vP1Yi4F00k9hQv7WOuZ7HuworZJ20$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/BDCIKUXR33AGRAD3J6ADQJTX54DG5AVCNFSM6AAAAAA5UXGDWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBZGUZDEMJTGU__;!!PYhZlW11KQ!At6a-mUZ2_0h3ZExu15CQVqpQZnojk9gKgGnmVeM4-utG23Vg0MTiJb4i_vP1Yi4F00k9hQv7WOuZ7HujGgAIFk$ . You are receiving this because you were mentioned.Message ID: <GoogleCloudPlatform/application-integration-management-toolkit/issues/140/1749522135 @github.com>

--

Vaibhav Misra

Senior Engineer

Sales Technology

Pronouns: He/Him/His

Wayfair

M: (+1-585-233-9899)

Email: @.***

srinandan commented 11 months ago

Closing this issue. Please re-open if these features don't work as expected.