WIP: add bws

This commit is contained in:
2025-06-10 17:13:57 -07:00
parent 825c2b78a5
commit d156883605
6 changed files with 153 additions and 71 deletions

3
contrib/bws-client.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
bws secret get --output env "e4fca935-28fa-4ca5-bcc9-b19d018ae606"

16
contrib/bws_client.py Normal file
View 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()