Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit 6daea44

Browse files
committed
Merge branch 'develop'
2 parents 46b2bfc + ce61f3e commit 6daea44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+630
-1425
lines changed

awscdk/setup.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,32 @@
1515
package_dir={"": "awscdk"},
1616
packages=setuptools.find_packages(where="awscdk"),
1717
install_requires=[
18-
"aws-cdk.core==1.70.0",
19-
"aws-cdk.aws_cloudformation==1.70.0",
20-
"aws-cdk.aws_autoscaling==1.70.0",
21-
"aws-cdk.aws_applicationautoscaling==1.70.0",
22-
"aws-cdk.aws_certificatemanager==1.70.0",
23-
"aws-cdk.aws_cloudwatch==1.70.0",
24-
"aws-cdk.aws_logs==1.70.0",
25-
"aws-cdk.aws_lambda==1.70.0",
26-
"aws-cdk.aws_events==1.70.0",
27-
"aws-cdk.aws_events_targets==1.70.0",
28-
"aws-cdk.aws_secretsmanager==1.70.0",
29-
"aws-cdk.aws_route53==1.70.0",
30-
"aws-cdk.aws_s3==1.70.0",
31-
"aws_cdk.aws_s3_deployment==1.70.0",
32-
"aws-cdk.aws_cloudfront==1.70.0",
33-
"aws-cdk.aws_route53_targets==1.70.0",
34-
"aws-cdk.aws_ecr==1.70.0",
35-
"aws-cdk.aws_ec2==1.70.0",
36-
"aws-cdk.aws_rds==1.70.0",
37-
"aws-cdk.aws_ssm==1.70.0",
38-
"aws-cdk.aws_elasticache==1.70.0",
39-
"aws-cdk.aws_elasticloadbalancingv2==1.70.0",
40-
"aws-cdk.aws_ecs==1.70.0",
41-
"aws-cdk.aws_ecs_patterns==1.70.0",
42-
"aws-cdk.aws_autoscaling==1.70.0",
43-
"aws-cdk.aws_sqs==1.70.0",
18+
"aws-cdk.core==1.71.0",
19+
"aws-cdk.aws_cloudformation==1.71.0",
20+
"aws-cdk.aws_autoscaling==1.71.0",
21+
"aws-cdk.aws_applicationautoscaling==1.71.0",
22+
"aws-cdk.aws_certificatemanager==1.71.0",
23+
"aws-cdk.aws_cloudwatch==1.71.0",
24+
"aws-cdk.aws_logs==1.71.0",
25+
"aws-cdk.aws_lambda==1.71.0",
26+
"aws-cdk.aws_events==1.71.0",
27+
"aws-cdk.aws_events_targets==1.71.0",
28+
"aws-cdk.aws_secretsmanager==1.71.0",
29+
"aws-cdk.aws_route53==1.71.0",
30+
"aws-cdk.aws_s3==1.71.0",
31+
"aws_cdk.aws_s3_deployment==1.71.0",
32+
"aws-cdk.aws_cloudfront==1.71.0",
33+
"aws-cdk.aws_route53_targets==1.71.0",
34+
"aws-cdk.aws_ecr==1.71.0",
35+
"aws-cdk.aws_ec2==1.71.0",
36+
"aws-cdk.aws_rds==1.71.0",
37+
"aws-cdk.aws_ssm==1.71.0",
38+
"aws-cdk.aws_elasticache==1.71.0",
39+
"aws-cdk.aws_elasticloadbalancingv2==1.71.0",
40+
"aws-cdk.aws_ecs==1.71.0",
41+
"aws-cdk.aws_ecs_patterns==1.71.0",
42+
"aws-cdk.aws_autoscaling==1.71.0",
43+
"aws-cdk.aws_sqs==1.71.0",
4444
],
4545
python_requires=">=3.6",
4646
classifiers=[
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 3.1.2 on 2020-11-17 07:35
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('accounts', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='customuser',
15+
name='first_name',
16+
field=models.CharField(blank=True, max_length=150, verbose_name='first name'),
17+
),
18+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 3.1.2 on 2020-11-24 03:23
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('accounts', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='customuser',
15+
name='first_name',
16+
field=models.CharField(blank=True, max_length=150, verbose_name='first name'),
17+
),
18+
]

backend/apps/accounts/urls.py

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
11
from django.urls import include, path, re_path
2-
from rest_framework_simplejwt.views import (
3-
TokenObtainPairView,
4-
TokenRefreshView,
5-
TokenVerifyView,
6-
)
72

83
from . import views
94

5+
106
urlpatterns = [
11-
re_path(
12-
r"^auth/obtain_token/",
13-
TokenObtainPairView.as_view(),
14-
name="api-jwt-auth",
15-
),
16-
re_path(
17-
r"^auth/refresh_token/",
18-
TokenRefreshView.as_view(),
19-
name="api-jwt-refresh",
7+
path('login-set-cookie/', views.login_set_cookie, name="login-view"),
8+
path('login/', views.login_view, name="login-view"),
9+
path('logout/', views.logout_view, name="logout-view"),
10+
path(
11+
"users/profile/",
12+
views.Profile.as_view(),
13+
name="user-profile",
2014
),
21-
re_path(
22-
r"^auth/verify_token/",
23-
TokenVerifyView.as_view(),
24-
name="api-jwt-verify",
25-
),
26-
path("users/profile/", views.Profile.as_view(), name="user-profile",),
2715
# Social Auth Callbacks
28-
path("social/<backend>/", views.exchange_token, name="social-auth",),
16+
path(
17+
"social/<backend>/",
18+
views.exchange_token,
19+
name="social-auth",
20+
),
2921
]
3022

3123
urlpatterns += [

backend/apps/accounts/views.py

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
import json
2+
13
from django.conf import settings
2-
from django.contrib.auth import get_user_model
4+
from django.contrib.auth import authenticate, get_user_model, login, logout
5+
from django.http import JsonResponse
6+
from django.views.decorators.csrf import ensure_csrf_cookie
7+
from django.views.decorators.http import require_POST
38
from requests.exceptions import HTTPError
49
from rest_framework import permissions, serializers, status
510
from rest_framework.decorators import api_view, permission_classes
@@ -15,6 +20,43 @@
1520
User = get_user_model()
1621

1722

23+
@require_POST
24+
def logout_view(request):
25+
logout(request)
26+
return JsonResponse({"detail": "Logout Successful"})
27+
28+
29+
@ensure_csrf_cookie
30+
def login_set_cookie(request):
31+
"""
32+
`login_view` requires that a csrf cookie be set.
33+
`getCsrfToken` in `auth.js` uses this cookie to
34+
make a request to `login_view`
35+
"""
36+
return JsonResponse({"details": "CSRF cookie set"})
37+
38+
39+
@require_POST
40+
def login_view(request):
41+
"""
42+
This function logs in the user and returns
43+
and HttpOnly cookie, the `sessionid` cookie
44+
"""
45+
data = json.loads(request.body)
46+
email = data.get('email')
47+
password = data.get('password')
48+
if email is None or password is None:
49+
return JsonResponse(
50+
{"errors": {"__all__": "Please enter both username and password"}},
51+
status=400,
52+
)
53+
user = authenticate(email=email, password=password)
54+
if user is not None:
55+
login(request, user)
56+
return JsonResponse({"detail": "Success"})
57+
return JsonResponse({"detail": "Invalid credentials"}, status=400)
58+
59+
1860
def get_tokens_for_user(user):
1961
refresh = RefreshToken.for_user(user)
2062

@@ -29,7 +71,10 @@ class SocialSerializer(serializers.Serializer):
2971
Serializer which accepts an OAuth2 code.
3072
"""
3173

32-
code = serializers.CharField(allow_blank=False, trim_whitespace=True,)
74+
code = serializers.CharField(
75+
allow_blank=False,
76+
trim_whitespace=True,
77+
)
3378

3479

3580
@api_view(http_method_names=["POST"])

backend/backend/settings/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@
172172
CHANNEL_LAYERS = {
173173
"default": {
174174
"BACKEND": "channels_redis.core.RedisChannelLayer",
175-
"CONFIG": {"hosts": [(REDIS_SERVICE_HOST, 6379)],}, # noqa
175+
"CONFIG": {
176+
"hosts": [(REDIS_SERVICE_HOST, 6379)],
177+
}, # noqa
176178
},
177179
}
178180

@@ -193,9 +195,7 @@
193195
"rest_framework.permissions.IsAuthenticated",
194196
),
195197
"DEFAULT_AUTHENTICATION_CLASSES": (
196-
"rest_framework_simplejwt.authentication.JWTAuthentication",
197198
"rest_framework.authentication.SessionAuthentication",
198-
# 'rest_framework.authentication.BasicAuthentication',
199199
),
200200
}
201201

cypress/support/commands.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,18 @@
99
// ***********************************************
1010
//
1111
//
12-
Cypress.Commands.add('login', () => {
12+
Cypress.Commands.add("login", () => {
1313
cy.request({
14-
url: '/api/auth/obtain_token/',
15-
method: 'POST',
14+
url: "/api/auth/obtain_token/",
15+
method: "POST",
1616
body: {
1717
email: "admin@company.com",
18-
password: "password"
18+
password: "password",
1919
},
2020
})
21-
.its('body')
22-
.then((body) => {
23-
cy.setCookie('user-token', body['access']);
24-
cy.setCookie('refresh-token', body['refresh']);
25-
});
26-
})
27-
21+
.its("body")
22+
.then(() => {});
23+
});
2824

2925
//
3026
//

quasar/babel.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
module.exports = {
2-
presets: [
3-
'@quasar/babel-preset-app'
4-
]
5-
}
2+
presets: ["@quasar/babel-preset-app"],
3+
};

quasar/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@
2525
"highcharts-vue": "1.3.5",
2626
"js-cookie": "2.2.1",
2727
"prettier": "2.1.2",
28-
"quasar": "1.14.2",
28+
"quasar": "1.14.5",
2929
"vue-apollo": "3.0.5",
3030
"vue-i18n": "8.22.1",
31-
"vue-native-websocket": "2.0.14"
31+
"vue-native-websocket": "2.0.14",
32+
"workbox-webpack-plugin": "5.0.0"
3233
},
3334
"devDependencies": {
34-
"@quasar/app": "2.1.5",
35+
"@quasar/app": "2.1.8",
3536
"@vue/eslint-config-prettier": "6.0.0",
3637
"babel-eslint": "10.1.0",
3738
"eslint": "7.12.0",

quasar/quasar.conf.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ module.exports = function (ctx) {
8484
env: ctx.dev
8585
? {
8686
API_URL: JSON.stringify(`http://${process.env.FULL_DOMAIN_NAME}`),
87-
WS_URL: JSON.stringify(`ws://${process.env.FULL_DOMAIN_NAME}`),
88-
GITHUB_KEY: JSON.stringify(process.env.GITHUB_KEY),
89-
GOOGLE_OAUTH2_KEY: JSON.stringify(process.env.GOOGLE_OAUTH2_KEY),
90-
FACEBOOK_KEY: JSON.stringify(process.env.FACEBOOK_KEY),
87+
WS_URL: `ws://${process.env.FULL_DOMAIN_NAME}`,
88+
GITHUB_KEY: process.env.GITHUB_KEY,
89+
GOOGLE_OAUTH2_KEY: process.env.GOOGLE_OAUTH2_KEY,
90+
FACEBOOK_KEY: process.env.FACEBOOK_KEY,
9191
}
9292
: {
9393
API_URL: JSON.stringify(`https://${process.env.FULL_DOMAIN_NAME}`),

0 commit comments

Comments
 (0)