WIP: add bws
This commit is contained in:
3
contrib/bws-client.sh
Normal file
3
contrib/bws-client.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
bws secret get --output env "e4fca935-28fa-4ca5-bcc9-b19d018ae606"
|
16
contrib/bws_client.py
Normal file
16
contrib/bws_client.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
|
||||
from bitwarden_sdk import BitwardenClient
|
||||
|
||||
ACCESS_TOKEN = os.getenv('BWS_ACCESS_TOKEN')
|
||||
assert ACCESS_TOKEN is not None, 'BWS_ACCESS_TOKEN environment variable is not set'
|
||||
SECRET_ID = 'e4fca935-28fa-4ca5-bcc9-b19d018ae606'
|
||||
|
||||
def main():
|
||||
client = BitwardenClient()
|
||||
client.auth().login_access_token(ACCESS_TOKEN)
|
||||
secret = client.secrets().get(SECRET_ID).data.value
|
||||
print(secret, end='')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Reference in New Issue
Block a user