environ

command
v0.0.0-...-9a6bae3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

Authenticate with environ

environ example provide code snippet for authenticate to YDB with environ variables

Authenticate produced with one of next environment variables:

  • YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS=<path/to/sa_key_file> — used service account key file by path
  • YDB_ANONYMOUS_CREDENTIALS="1" — used for authenticate with anonymous access. Anonymous access needs for connect to testing YDB installation
  • YDB_METADATA_CREDENTIALS="1" — used metadata service for authenticate to YDB from yandex cloud virtual machine or from yandex function
  • YDB_ACCESS_TOKEN_CREDENTIALS=<access_token> — used for authenticate to YDB with short-life access token. For example, access token may be IAM token

Runing code snippet

export YDB_CONNECTION_STRING="grpcs://endpoint/?database=database"
export YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS=/Users/user/.ydb/sa.jsoon 
environ
# or
export YDB_CONNECTION_STRING="grpcs://endpoint/?database=database"
export YDB_ANONYMOUS_CREDENTIALS="1" 
environ
# or
export YDB_CONNECTION_STRING="grpcs://endpoint/?database=database"
export YDB_METADATA_CREDENTIALS="1" 
environ
# or
export YDB_CONNECTION_STRING="grpcs://endpoint/?database=database"
export YDB_ACCESS_TOKEN_CREDENTIALS="YDB_ACCESS_TOKEN"
environ

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL