From d620acead5a6b02eaddef7bc9bae0b4bda6158fd Mon Sep 17 00:00:00 2001 From: kathy han Date: Wed, 13 Mar 2024 14:55:20 -0400 Subject: [PATCH] Updated typos --- .gitignore | 2 +- README.md | 8 ++++---- oauth.py | 34 +++++++++++++++++----------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index b6e4761..246fdbc 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ share/python-wheels/ MANIFEST # PyInstaller -# Usually these files are written by a python script from a template +# Usually, these files are written by a Python script from a template. # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec diff --git a/README.md b/README.md index 806dd4d..68f1256 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ Make sure to have Python 3 installed. -To run the server application, open a command terminal, and navigate to the folder where you saved this Python script. +To run the server application, open a command terminal and navigate to the folder where you saved this Python script. -Replace the required variables (Client ID, Secrect ID etc...) in the oauth.py file on lines 23 and 24, Replace the URL in the tag in +Replace the required variables (Client ID, Secrect ID etc.) in the oauth.py file on lines 23 and 24, Replace the URL in the tag in index.html, then run: *python3 oauth.py* @@ -13,6 +13,6 @@ You should see this in the terminal: Listening on http://0.0.0.0:10060... -copy and paste above URL into browser and follow prompts +copy and paste above URL into your browser and follow prompts -**Note**: Your Redirect_URI in the Integration's settings on Developer Webex Teams site should be: http://0.0.0.0:10060/oauth or if you're using any other hosting platform it would be https://YOUR_SERVER/oauth +**Note**: Your Redirect_URI in the Integration's settings on the Developer Webex site should be: http://0.0.0.0:10060/oauth or if you're using any other hosting platform it would be https://YOUR_SERVER/oauth diff --git a/oauth.py b/oauth.py index 0ddafae..5e79a04 100644 --- a/oauth.py +++ b/oauth.py @@ -30,18 +30,18 @@ Description : This is a utility function that takes in the Authorization Code as a parameter. The code is used to make a call to the access_token end - point on the webex api to obtain a access token - and a refresh token that is then stored as in the + point on the Webex API to obtain an access token + and a refresh token. These tokens are then stored in the Session for use in other parts of the app. NOTE: in production, auth tokens would not be stored in a Session. This app will request a new token each time - it runs which will not be able to check against expired tokens. + it runs, which will not be able to check against expired tokens. """ def get_tokens(code): print("function : get_tokens()") print("code:", code) - #STEP 3 : use code in response from webex api to collect the code parameter - #to obtain an access token or refresh token + #STEP 3 : use the code received from the Webex API response to collect the code parameter + #in order to obtain an access token or refresh token url = "https://webexapis.com/v1/access_token" headers = {'accept':'application/json','content-type':'application/x-www-form-urlencoded'} payload = ("grant_type=authorization_code&client_id={0}&client_secret={1}&" @@ -62,12 +62,12 @@ def get_tokens(code): """ Function Name : get_tokens_refresh() Description : This is a utility function that leverages the refresh token - in exchange for a fresh access_token and refresh_token - when a 401 is received when using an invalid access_token - while making an api_call(). + to exchange it for a fresh access_token and refresh_token + when a 401 is received while making an api_call() + with an invaild access_token. NOTE: in production, auth tokens would not be stored in a Session. This app will request a new token each time - it runs which will not be able to check against expired tokens. + it runs, which will not be able to check against expired tokens. """ def get_tokens_refresh(): print("function : get_token_refresh()") @@ -91,12 +91,12 @@ def get_tokens_refresh(): """ Function Name : main_page -Description : when using the browser to access server at +Description : When using the browser to access the server at http://127/0.0.1:10060 this function will - render the html file index.html. That file - contains the button that kicks off step 1 - of the Oauth process with the click of the - grant button + render the HTML file index.html. That file + contains the button that initiates step 1 + of the OAuth process with the click of the + grant button. """ @app.route("/") @@ -134,11 +134,11 @@ def oauth(): """ Funcion Name : spaces -Description : Now that we have our authentication code the spaces button - on the granted page can leverage this function to get list +Description : Now that we have our authentication code, the "Spaces" button + on the granted page can leverage this function to get a list of spaces that the user behind the token is listed in. The Authentication Token is accessed via Session Key 'oauth_token' - and used to construct the api call in authenticated mode. + and used to construct the API call in authenticated mode. """ @app.route("/spaces",methods=['GET']) def spaces():