Home

Awesome

ydb-go-sdk-auth-environ

helpers to connect to YDB using environ

Installation <a name="Installation"></a>

go get -u github.com/ydb-platform/ydb-go-sdk-auth-environ

Usage <a name="Usage"></a>

import (
	env "github.com/ydb-platform/ydb-go-sdk-auth-environ"
)
...
    db, err := ydb.New(
        ctx,
        connectParams,
        env.WithEnvironCredentials(ctx), 
    )
    

Auth environment variables

NameTypeDefaultyandex-cloudDescription
YDB_ANONYMOUS_CREDENTIALS0 or 10-flag for use anonymous credentials
YDB_ACCESS_TOKEN_CREDENTIALSstring+/-use access token for authenticate with YDB. For authenticate with YDB inside yandex-cloud use short-life IAM-token. Other YDB installations can use access token depending on authenticate method
YDB_STATIC_CREDENTIALS_USER<br>YDB_STATIC_CREDENTIALS_PASSWORD<br>YDB_STATIC_CREDENTIALS_ENDPOINT<br/>string<br>string<br>string-static credentials from user, password and auth service endpoint
YDB_METADATA_CREDENTIALS0 or 1+flag for use metadata credentials
YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALSstring+path to service account key file credentials
YDB_SERVICE_ACCOUNT_KEY_CREDENTIALSstring+service account key credentials