-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from nicoangelo/feature/attachments
- Loading branch information
Showing
5 changed files
with
51 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import json | ||
from utils.utils import get_secret_from_bitwarden, get_attachment, parse_fields_scope, parse_login_scope | ||
|
||
from utils.utils import get_secret_from_bitwarden, parse_fields_scope, parse_login_scope | ||
|
||
class BitwardenLookupHandler: | ||
|
||
def bitwarden_lookup(id, scope, field): | ||
_secret_json = get_secret_from_bitwarden(None, id) | ||
if scope == "login": | ||
return parse_login_scope(_secret_json, field) | ||
if scope == "fields": | ||
return parse_fields_scope(_secret_json, field) | ||
def __init__(self, logger) -> None: | ||
self.logger = logger | ||
|
||
def bitwarden_lookup(self, id, scope, field): | ||
if scope == "attachment": | ||
return get_attachment(self.logger, id, field) | ||
_secret_json = get_secret_from_bitwarden(self.logger, id) | ||
if scope == "login": | ||
return parse_login_scope(_secret_json, field) | ||
if scope == "fields": | ||
return parse_fields_scope(_secret_json, field) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters