Skip to main content

CredentialsClient

Client for managing credentials for any Datagrok entity. Credentials can be associated with data connections, packages, or other entity types.

Examples

Get credentials for a connection

>>> creds = grok.credentials.for_entity(connection.id)
>>> print(creds.parameters)

Save credentials for a package

>>> creds = grok.credentials.for_entity(package.id)
>>> creds.parameters['apiKey'] = 'new-key'
>>> grok.credentials.save(creds)

Methods

__init__()

for_entity()

Get credentials for an entity by its ID.

Parameters

NameTypeDescription
entity_idstrThe entity ID (UUID) to retrieve credentials for.

Returns

TypeDescription
CredentialsThe credentials associated with the entity.

save()

Save or update credentials. The credentials must have entity_bind_id set to associate them with an entity. Typically, first call for_entity() to load existing credentials, modify parameters, then save.

Parameters

NameTypeDescription
credentialsCredentialsThe credentials object to save.

delete()

Delete credentials by object or ID.

Parameters

NameTypeDescription
credentialsCredentials or strThe credentials object or credentials ID to delete.