Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK-4362] Rewrite QS to use Django 4.2 (LTS) from 2.2 (EOL'd), and PyJWT 2.7 from 1.7 (EOL'd) #66

Merged
merged 3 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@ jobs:
working_directory: ~/repo/01-Authorization
machine:
image: ubuntu-2004:202107-02

steps:
- checkout:
path: ~/repo
path: ~/repo

- run:
- run:
name: Set .env file
command: |
echo "AUTH0_DOMAIN=$auth0_domain" >> .env
echo "API_IDENTIFIER=$api_identifier" >> .env

- run:
name: background server
command: sh exec.sh
background: true

echo "AUTH0_DOMAIN=$auth0_domain" >> .env
echo "AUTH0_API_IDENTIFIER=$api_identifier" >> .env

- run:
name: Wait until server is online
command: |
until $(curl --output /dev/null --silent --fail http://localhost:3010/api/public); do
sleep 5
done

name: background server
command: sh exec.sh
background: true

- run:
name: Wait until server is online
command: |
until $(curl --output /dev/null --silent --fail http://localhost:8000/api/public); do
sleep 5
done

- run:
name: Clone script test
command: git clone -b v0.0.1 --depth 1 https://github.com/auth0-samples/api-quickstarts-tests test
- run:

- run:
name: Prepare environment variables for test
command: |
cd test
Expand All @@ -45,7 +45,7 @@ jobs:
echo "AUTH0_CLIENT_SECRET_3=$client_secret_scopes_write" >> .env
echo "AUTH0_CLIENT_ID_4=$client_id_scopes_readwrite" >> .env
echo "AUTH0_CLIENT_SECRET_4=$client_secret_scopes_readwrite" >> .env
echo "API_URL=http://localhost:3010" >> .env
echo "API_URL=http://localhost:8000" >> .env

- run:
name: Install test script dependency
Expand All @@ -60,4 +60,3 @@ workflows:
jobs:
- build:
context: Quickstart API Tests

2 changes: 1 addition & 1 deletion 01-Authorization/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
AUTH0_DOMAIN={DOMAIN}
API_IDENTIFIER={API_IDENTIFIER}
AUTH0_API_IDENTIFIER={API_IDENTIFIER}
4 changes: 3 additions & 1 deletion 01-Authorization/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.env
db.sqlite3
*.pyc
*.pyc
requirements.in
__pycache__
8 changes: 4 additions & 4 deletions 01-Authorization/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ WORKDIR /home/app

#If we add the requirements and install dependencies first, docker can use cache if requirements don't change
ADD requirements.txt /home/app
RUN pip install --no-cache-dir -r requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt

ADD . /home/app

# Migrate the database
RUN python manage.py migrate
RUN python3 manage.py migrate

CMD python manage.py runserver 0.0.0.0:3010
CMD python manage.py runserver 0.0.0.0:8000

EXPOSE 3010
EXPOSE 8000
169 changes: 0 additions & 169 deletions 01-Authorization/apiexample/settings.py

This file was deleted.

22 changes: 0 additions & 22 deletions 01-Authorization/apiexample/urls.py

This file was deleted.

16 changes: 16 additions & 0 deletions 01-Authorization/app/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for example project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")

application = get_asgi_application()
Loading