Skip to content

Commit

Permalink
feat: source username and password from env
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Mar 1, 2024
1 parent 3e342d8 commit 38b1788
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions netsuite/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def _reorganize_auth_keys(raw: t.Dict[str, t.Any]) -> t.Dict[str, t.Any]:
reorganized: t.Dict[t.Any, t.Any] = {"auth": {}}

for key, val in raw.items():
if key in TokenAuth.model_fields:
if (
key in TokenAuth.model_fields
or key in UsernamePasswordAuth.model_fields
):
reorganized["auth"][key] = val
else:
reorganized[key] = val
Expand All @@ -81,6 +84,8 @@ def from_env(cls):
- `NETSUITE_CONSUMER_SECRET`: The consumer secret for OAuth.
- `NETSUITE_TOKEN_ID`: The token ID for OAuth.
- `NETSUITE_TOKEN_SECRET`: The token secret for OAuth.
- `NETSUITE_USERNAME`: The username for login auth (only for odbc).
- `NETSUITE_PASSWORD`: The password for login auth (only for odbc).
- `NETSUITE_LOG_LEVEL`: log level for NetSuite debugging
Returns a dictionary of available config options.
Expand All @@ -93,7 +98,8 @@ def from_env(cls):
"consumer_secret",
"token_id",
"token_secret",
"log_level",
"username",
"password" "log_level",
]
prefix = "NETSUITE_"
raw = {
Expand Down

0 comments on commit 38b1788

Please sign in to comment.