mirror of
https://github.com/vale981/outlook-oauth-hack
synced 2025-03-04 08:31:38 -05:00
allow default options and overrides
This commit is contained in:
parent
f85a1900b7
commit
dd4e37d8a5
3 changed files with 11 additions and 4 deletions
|
@ -8,10 +8,9 @@ def get_config(profile):
|
|||
with open(Path.home() / ".o365-auth-config.toml", "rb") as f:
|
||||
toplevel_data = tomllib.load(f)
|
||||
|
||||
if profile not in toplevel_data:
|
||||
sys.exit("Invalid profile specified.")
|
||||
|
||||
config_data = toplevel_data[profile]
|
||||
default_data = toplevel_data["default"]
|
||||
config_data = default_data | toplevel_data.get(profile, {})
|
||||
cache_path = Path.home() / ".cache/o365-oauth" / profile
|
||||
cache_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
|
8
config.toml
Normal file
8
config.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
[default]
|
||||
ClientId = "08162f7c-0fd2-4200-a84a-f25a4db0b584"
|
||||
ClientSecret = "TxRBilcHdC6WGBee]fs?QR:SJ8nI[g82"
|
||||
Scopes = ['https://outlook.office.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send']
|
||||
|
||||
Authority = false
|
||||
|
||||
[mcgill]
|
|
@ -20,7 +20,7 @@ in
|
|||
config = mkOption {
|
||||
type = types.str;
|
||||
default = ''
|
||||
[mcgill]
|
||||
[default]
|
||||
ClientId = "08162f7c-0fd2-4200-a84a-f25a4db0b584"
|
||||
ClientSecret = "TxRBilcHdC6WGBee]fs?QR:SJ8nI[g82"
|
||||
Scopes = ['https://outlook.office.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send']
|
||||
|
|
Loading…
Add table
Reference in a new issue