Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_manager(self, context):
return CredentialManager(
self._session_key,
owner=self._endpoint.user,
app=self._endpoint.app,
realm=context.realm(),
scheme=self._splunkd_info.scheme,
host=self._splunkd_info.hostname,
port=self._splunkd_info.port
)
def _cred_mgr(self):
if self._cred_manager is None:
self._cred_manager = CredentialManager(
self._session_key, self._app, owner=self._owner,
realm=self._app, scheme=self._scheme, host=self._host,
port=self._port, **self._context)
return self._cred_manager
def decrypt_all(self, data):
"""
:param data:
:return: changed stanza list
"""
credential_manager = CredentialManager(
self._session_key,
owner=self._endpoint.user,
app=self._endpoint.app,
realm=self._realm,
scheme=self._splunkd_info.scheme,
host=self._splunkd_info.hostname,
port=self._splunkd_info.port
)
all_passwords = credential_manager._get_all_passwords()
# filter by realm
realm_passwords = [x for x in all_passwords if x['realm'] == self._realm]
return self._merge_passwords(data, realm_passwords)