diff --git a/backend/CHANGELOG.md b/backend/CHANGELOG.md new file mode 100644 index 000000000..6e03f6fe9 --- /dev/null +++ b/backend/CHANGELOG.md @@ -0,0 +1,12 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + + +## [0.0.1] - 2021-11-10 + +### Added +- Allow for missing first/last names in userinfo, defaulting to " " diff --git a/backend/app/routers/keycloak.py b/backend/app/routers/keycloak.py index 8ec1688a2..f9ebb3357 100644 --- a/backend/app/routers/keycloak.py +++ b/backend/app/routers/keycloak.py @@ -123,8 +123,8 @@ async def auth( # create user in db if it doesn't already exist; get the user_id userinfo = keycloak_openid.userinfo(access_token) keycloak_id = userinfo["sub"] - given_name = userinfo["given_name"] - family_name = userinfo["family_name"] + given_name = userinfo.get("given_name", " ") + family_name = userinfo.get("family_name", " ") email = userinfo["email"] user = UserDB( email=email, diff --git a/backend/docs/README.md b/backend/docs/README.md index 527966df9..dc86e17fa 100644 --- a/backend/docs/README.md +++ b/backend/docs/README.md @@ -5,10 +5,10 @@ Uses [Sphinx](https://www.sphinx-doc.org). Requires [enchant](https://pyenchant. ```shell # build -make build +make html # view -python -m http.server --directory build/html +python3 -m http.server --directory build/html # check links make linkcheck @@ -22,4 +22,4 @@ make spelling ``` Great [talk](https://www.youtube.com/watch?v=0ROZRNZkPS8) on Sphinx. -Sphinx [themes](https://sphinx-themes.org/). \ No newline at end of file +Sphinx [themes](https://sphinx-themes.org/). diff --git a/backend/docs/source/img/pycharm1.png b/backend/docs/source/img/pycharm1.png new file mode 100644 index 000000000..f75f6379e Binary files /dev/null and b/backend/docs/source/img/pycharm1.png differ diff --git a/backend/docs/source/img/pycharm1a.png b/backend/docs/source/img/pycharm1a.png new file mode 100644 index 000000000..3e0ccd58e Binary files /dev/null and b/backend/docs/source/img/pycharm1a.png differ diff --git a/backend/docs/source/img/pycharm2.png b/backend/docs/source/img/pycharm2.png new file mode 100644 index 000000000..9abcb8dbc Binary files /dev/null and b/backend/docs/source/img/pycharm2.png differ diff --git a/backend/docs/source/index.rst b/backend/docs/source/index.rst index c2f0569f2..26c29201a 100644 --- a/backend/docs/source/index.rst +++ b/backend/docs/source/index.rst @@ -11,6 +11,7 @@ Welcome to Clowder v2's documentation! :caption: Contents: mongo-fastapi.md + pycharm.md diff --git a/backend/docs/source/pycharm.md b/backend/docs/source/pycharm.md new file mode 100644 index 000000000..c9becf1ff --- /dev/null +++ b/backend/docs/source/pycharm.md @@ -0,0 +1,21 @@ +### How to setup pycharm to work with Clowder V2 + +From the main menu select Run -> Edit Configurations... + +Click on '+' to add a 'Python' configuration, and name it 'uvicorn' + +![Run/Debug_Config1](img/pycharm1.png) + +Select 'Module name" and use: 'uvicorn' + +With parameters: 'app.main:app --reload' + +![Run/Debug_Config_line1](img/pycharm1a.png) + +Click '+' again and add a 'JavaScript Debug' configuraion, and name it 'frontend' + +![Run/Debug_Config2](img/pycharm2.png) + +With URL: 'http://localhost:3000' + +and I chose 'Chrome' browser