-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python SDK: Refactoring response from the server and adding warning l…
…ogs (#215)
- Loading branch information
Showing
3 changed files
with
68 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
# Contact: [email protected] | ||
import json | ||
import os | ||
from datetime import datetime | ||
|
||
import requests | ||
from keeper_secrets_manager_core.crypto import CryptoUtils | ||
|
@@ -411,3 +412,35 @@ def to_json(self): | |
|
||
json_object = json.dumps(self.to_dict(), indent=4) | ||
return json_object | ||
|
||
|
||
class AppData: | ||
""" | ||
Application info | ||
""" | ||
def __init__(self, title="", app_type=""): | ||
self.title = title | ||
self.app_type = app_type | ||
|
||
|
||
class SecretsManagerResponse: | ||
|
||
""" | ||
Server response contained details about the application and the records | ||
that were requested to be returned | ||
""" | ||
def __init__(self): | ||
self.appData = None | ||
# self.encryptedAppKey = None | ||
# self.appOwnerPublicKey = None | ||
self.folders = None | ||
self.records = None | ||
self.expiresOn = None | ||
self.warnings = None | ||
self.justBound = False | ||
|
||
def expires_on_str(self, date_format='%Y-%m-%d %H:%M:%S'): | ||
""" | ||
Retrieve string formatted expiration date | ||
""" | ||
return datetime.fromtimestamp(self.expiresOn/1000).strftime(date_format) |
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