testing #14
@@ -24,23 +24,13 @@ class bitwardenUtils():
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
|
||||
def __init__(self, access_token, organization_id):
|
||||
self.access_token = access_token
|
||||
self.organization_id = organization_id
|
||||
client = BitwardenClient(
|
||||
client_settings_from_dict(
|
||||
{
|
||||
"apiUrl": os.getenv("API_URL", "https://bitwarden.tryton.geeraert.eu/api"),
|
||||
"deviceType": DeviceType.SDK,
|
||||
"identityUrl": os.getenv("IDENTITY_URL", "https://bitwarden.tryton.geeraert.eu/identity"),
|
||||
"userAgent": "Python",
|
||||
}
|
||||
)
|
||||
)
|
||||
self.client.auth().login_access_token(self.access_token, self.state_path)
|
||||
def __init__(self, __access_token, __organization_id):
|
||||
self.__access_token = __access_token
|
||||
self.__organization_id = __organization_id
|
||||
self.client.auth().login_access_token(self.__access_token, self.state_path)
|
||||
|
||||
def create_project(self,project_name):
|
||||
project = self.client.projects().create(self.organization_id, project_name)
|
||||
project = self.client.projects().create(self.__organization_id, project_name)
|
||||
return project.data.id
|
||||
|
||||
def generate_strong_password(self):
|
||||
@@ -49,7 +39,7 @@ class bitwardenUtils():
|
||||
|
||||
def create_secret(self,project_id,secret_name,secret_value,description="description"):
|
||||
secret = self.client.secrets().create(
|
||||
self.organization_id,
|
||||
self.__organization_id,
|
||||
secret_name,
|
||||
secret_value,
|
||||
description,
|
||||
|
||||
Reference in New Issue
Block a user