Skip to content

Commit e4cee90

Browse files
authored
Merge pull request #21 from britive/develop
v0.3.1
2 parents 41b5ff0 + 3468c95 commit e4cee90

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Change Log
2+
3+
All changes to the package starting with v0.3.1 will be logged here.
4+
5+
6+
## v0.3.1 [2022-09-13]
7+
#### What's New
8+
* None
9+
10+
### Enhancements
11+
* None
12+
13+
#### Bug Fixes
14+
* Fixes an issue with Britive tenant credential encryption when using `backend-credential-process=encrypted-file`. If an invalid `--passphrase` is provided the encrypted credentials will now be removed and a new interactive login process will commence.
15+
16+
#### Dependencies
17+
* None
18+
19+
#### Other
20+
* None

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pybritive
3-
version = 0.3.0
3+
version = 0.3.1
44
author = Britive Inc.
55
author_email = support@britive.com
66
description = A pure Python CLI for Britive

src/pybritive/helpers/credentials.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, tenant_name: str, tenant_alias: str, cli: ConfigManager):
5656
self.credentials = self.load() or {}
5757

5858
def perform_interactive_login(self):
59-
self.cli.print(f'Performing interactive login against tenant {self.tenant}')
59+
self.cli.print(f'Performing interactive login against tenant {self.tenant}.')
6060
url = f'{self.base_url}/login?token={self.auth_token}'
6161

6262
try:
@@ -190,7 +190,10 @@ def decrypt(self, encrypted_access_token: str):
190190
try:
191191
return self.string_encryptor.decrypt(ciphertext=encrypted_access_token)
192192
except InvalidPassphraseException:
193-
click.ClickException('invalid passphrase provided - cannot decrypt credentials.')
193+
self.cli.print('invalid passphrase provided - wiping credentials and forcing a re-authentication.')
194+
self.delete()
195+
self.credentials = self.load() or {}
196+
return self.get_token()
194197

195198
def encrypt(self, decrypted_access_token: str):
196199
return self.string_encryptor.encrypt(plaintext=decrypted_access_token)

0 commit comments

Comments
 (0)