This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_token() -> dict | None: | |
| """ | |
| Begins OAuth workflow to retrieve a bearer token. | |
| if successful, returns { | |
| 'Authorization': "Bearer <access_token>" | |
| } | |
| else None | |
| """ | |
| # https://api.sharefile.com/gettingstarted/oauth2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tenant_id = os.getenv('M365_TENANT_ID') | |
| url = f"https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token" | |
| data = { | |
| 'client_id': os.getenv("M365_APP_ID"), | |
| 'scope': os.getenv("M365_SCOPE"), | |
| 'client_secret': os.getenv("M365_APP_SECRET"), | |
| 'grant_type': 'client_credentials' | |
| } | |
| result = requests.post(url, data=data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .editor-group-watermark > .letterpress { | |
| background-image: url("https://raw.githubusercontent.com/Aikoyori/ProgrammingVTuberLogos/main/VSCode/VSCode.png") !important; | |
| opacity: .75; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load Excel powershell module; install if it doesn't exist | |
| if (Get-Module -ListAvailable -Name ImportExcel) { | |
| Write-Host "Excel module check passes" | |
| } | |
| else { | |
| try { | |
| Install-Module -Name ImportExcel -AllowClobber -Confirm:$False -Force | |
| } | |
| catch [Exception] { | |
| $_.message |