Skip to content

Commit

Permalink
fix: credentials error
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCloudSec committed Feb 26, 2025
1 parent e8ccd66 commit b5cf294
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions prowler/providers/nhn/nhn_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class NhnProvider(Provider):
"""

_type: str = "nhn"
_session: Optional[requests.Session] = None
_session: Optional[requests.Session]
_identity: NHNIdentityInfo
_audit_config: dict
_mutelist: NHNMutelist
Expand Down Expand Up @@ -184,9 +184,6 @@ def setup_session(self) -> None:
On success, it creates a requests.Session and sets the X-Auth-Token header.
"""
if not self._username or not self._password:
logger.warning("NHN Provider - username/password not set.")
return
url = "https://api-identity-infrastructure.nhncloudservice.com/v2.0/tokens"
data = {
"auth": {
Expand All @@ -209,9 +206,10 @@ def setup_session(self) -> None:
self._session = sess
logger.info("NHN token acquired successfully and session is set up.")
else:
logger.error(
logger.critical(
f"Failed to get token. Status: {response.status_code}, Body: {response.text}"
)
sys.exit(1)
except Exception as e:
logger.critical(f"[setup_session] Error: {e}")
sys.exit(1)
Expand Down

0 comments on commit b5cf294

Please sign in to comment.