Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class VaultError(Exception):
def __init__(self, message=None, errors=None):
if errors:
message = ', '.join(errors)
self.errors = errors
super(VaultError, self).__init__(message)
class InvalidRequest(VaultError):
pass
class Unauthorized(VaultError):
pass
class Forbidden(VaultError):
pass
class InvalidPath(VaultError):
pass
class RateLimitExceeded(VaultError):
pass
class RateLimitExceeded(VaultError):
pass
class InternalServerError(VaultError):
pass
class VaultNotInitialized(VaultError):
pass
class VaultDown(VaultError):
pass
class UnexpectedError(VaultError):
pass
class ParamValidationError(VaultError):
pass
message = ', '.join(errors)
self.errors = errors
super(VaultError, self).__init__(message)
class InvalidRequest(VaultError):
pass
class Unauthorized(VaultError):
pass
class Forbidden(VaultError):
pass
class InvalidPath(VaultError):
pass
class RateLimitExceeded(VaultError):
pass
class InternalServerError(VaultError):
pass
class VaultNotInitialized(VaultError):
pass
class Unauthorized(VaultError):
pass
class Forbidden(VaultError):
pass
class InvalidPath(VaultError):
pass
class RateLimitExceeded(VaultError):
pass
class InternalServerError(VaultError):
pass
class VaultNotInitialized(VaultError):
pass
class VaultDown(VaultError):
pass
class UnexpectedError(VaultError):
def __init__(self, message=None, errors=None):
if errors:
message = ', '.join(errors)
self.errors = errors
super(VaultError, self).__init__(message)
class VaultError(Exception):
def __init__(self, message=None, errors=None):
if errors:
message = ', '.join(errors)
self.errors = errors
super(VaultError, self).__init__(message)
class InvalidRequest(VaultError):
pass
class Unauthorized(VaultError):
pass
class Forbidden(VaultError):
pass
class InvalidPath(VaultError):
pass
class RateLimitExceeded(VaultError):
pass
class InternalServerError(VaultError):
def _populate_envvars_from_vault(self):
if self.vault is None or not self.spec.vault.env:
return
paths = [v[0] for v in self.spec.vault.env.values()]
secrets = {}
for path in paths:
try:
res = self.vault.read(path)
except VaultError as exc:
raise InvalidSpecification('Error reading {} from Vault: {}'.format(path, str(exc)))
if not res:
raise InvalidSpecification('Error reading {} from Vault: not found'.format(path))
secrets[path] = res['data']
for name, (path, key) in self.spec.vault.env.items():
val = secrets.get(path, {}).get(key)
if val is not None:
self.context.environment.setdefault(name, val)
super(VaultError, self).__init__(message)
class InvalidRequest(VaultError):
pass
class Unauthorized(VaultError):
pass
class Forbidden(VaultError):
pass
class InvalidPath(VaultError):
pass
class RateLimitExceeded(VaultError):
pass
class InternalServerError(VaultError):
pass
class VaultNotInitialized(VaultError):
pass
class VaultDown(VaultError):
pass
class InvalidPath(VaultError):
pass
class RateLimitExceeded(VaultError):
pass
class InternalServerError(VaultError):
pass
class VaultNotInitialized(VaultError):
pass
class VaultDown(VaultError):
pass
class UnexpectedError(VaultError):
pass
class ParamValidationError(VaultError):
pass
pass
class Forbidden(VaultError):
pass
class InvalidPath(VaultError):
pass
class RateLimitExceeded(VaultError):
pass
class InternalServerError(VaultError):
pass
class VaultNotInitialized(VaultError):
pass
class VaultDown(VaultError):
pass
class UnexpectedError(VaultError):
pass
class ParamValidationError(VaultError):