Skip to content

Commit e169cab

Browse files
authored
Merge pull request #22 from mbrg/cleanup
Cleanup
2 parents 375a673 + 18ef94d commit e169cab

File tree

2 files changed

+7
-37
lines changed

2 files changed

+7
-37
lines changed

src/powerpwn/powerdoor/readme.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/powerpwn/powerdump/utils/auth.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ def acquire_token(scope: str, tenant: Optional[str] = None) -> str:
4343
)
4444
)
4545

46-
bearer = azure_cli_bearer_tokens_for_scope.get("token_type") + " " + azure_cli_bearer_tokens_for_scope.get("access_token")
46+
if "token_type" not in azure_cli_bearer_tokens_for_scope or "access_token" not in azure_cli_bearer_tokens_for_scope:
47+
logger.debug(
48+
f"Acquired a token package with scope={scope}, tenant={tenant}. Received the following keys: {list(azure_cli_bearer_tokens_for_scope.key())}."
49+
)
50+
raise RuntimeError(f"Something went wrong when trying to fetch tokens with scope={scope}, tenant={tenant}. Try removing cached credentials.")
51+
52+
bearer = azure_cli_bearer_tokens_for_scope["token_type"] + " " + azure_cli_bearer_tokens_for_scope["access_token"]
4753
logger.info(f"Access token for {scope} acquired successfully")
4854

4955
# cache refresh token for cli to use in further FOCI authentication

0 commit comments

Comments
 (0)