Skip to content

Commit 6af4568

Browse files
author
lijianguo
committed
chore(test): test-style
1 parent 961bd04 commit 6af4568

13 files changed

Lines changed: 40 additions & 27 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# If DRYCC_REGISTRY is not set, try to populate it from legacy DEV_REGISTRY
22
DRYCC_REGISTRY ?= $(DEV_REGISTRY)
33
IMAGE_PREFIX ?= drycc
4-
COMPONENT ?= manager
4+
COMPONENT ?= passport
55
SHORT_NAME ?= $(COMPONENT)
66
PLATFORM ?= linux/amd64,linux/arm64
77

charts/passport/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: passport
22
home: https://github.com/drycc/passport
3-
version: <Will be populated by the ci before publishing the chart>
3+
version: v1.0.0
44
description: Drycc Workflow passport (API).
55
maintainers:
66
- name: Drycc Team

charts/passport/templates/_helpers.tpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rbac.authorization.k8s.io/v1
1212
{{- end -}}
1313

1414
{{/* Generate passport deployment envs */}}
15-
{{- define "passport.envs" -}}
15+
{{- define "passport.envs" }}
1616
env:
1717
- name: "TZ"
1818
value: {{ .Values.time_zone | default "UTC" | quote }}
@@ -28,13 +28,17 @@ env:
2828
secretKeyRef:
2929
name: passport-creds
3030
key: social-auth-drycc-controller-secret
31+
- name: WORKFLOW_NAMESPACE
32+
valueFrom:
33+
fieldRef:
34+
fieldPath: metadata.namespace
3135
{{- if (.Values.database_url) }}
3236
- name: DRYCC_DATABASE_URL
3337
valueFrom:
3438
secretKeyRef:
3539
name: passport-creds
3640
key: database-url
37-
{{- else if eq .Values.global.database_location "on-cluster" }}
41+
{{- else if eq .Values.global.database_location "on-cluster" }}
3842
- name: DRYCC_DATABASE_USER
3943
valueFrom:
4044
secretKeyRef:
@@ -53,10 +57,6 @@ env:
5357
- name: DRYCC_DATABASE_URL
5458
value: "postgres://$(DRYCC_DATABASE_USER):$(DRYCC_DATABASE_PASSWORD)@$(DRYCC_DATABASE_SERVICE_HOST):$(DRYCC_DATABASE_SERVICE_PORT)/$(DRYCC_DATABASE_NAME)"
5559
{{- end }}
56-
- name: WORKFLOW_NAMESPACE
57-
valueFrom:
58-
fieldRef:
59-
fieldPath: metadata.namespace
6060
{{- range $key, $value := .Values.environment }}
6161
- name: {{ $key }}
6262
value: {{ $value | quote }}

charts/passport/templates/passport-certificate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- if eq .Values.global.passport_location "on-cluster" }}
22
{{- if .Values.global.cert_passport_enabled }}
3-
apiVersion: cert-passport.io/v1alpha2
3+
apiVersion: cert-manager.io/v1alpha2
44
kind: Certificate
55
metadata:
66
name: drycc-passport

charts/passport/templates/passport-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ spec:
2525
serviceAccount: drycc-passport
2626
containers:
2727
- name: drycc-passport
28-
image: {{.Values.image_registry}}{{.Values.org}}/passport:{{.Values.image_tag}}
29-
imagePullPolicy: {{.Values.pull_policy}}
28+
image: {{.Values.image_registry}}/{{.Values.org}}/passport:{{.Values.image_tag}}
29+
imagePullPolicy: {{.Values.image_pull_policy}}
3030
livenessProbe:
3131
httpGet:
3232
path: /healthz

charts/passport/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
org: "drycc"
2-
pull_policy: "Always"
2+
image_pull_policy: "Always"
33
image_tag: "canary"
44
image_registry: ""
55
# Set passport deployment replicas

rootfs/Dockerfile.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >>/etc/apk/repositor
1111
libffi-dev \
1212
musl-dev \
1313
openldap-dev \
14+
openssl-dev \
15+
cargo \
16+
rust \
1417
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt \
1518
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/dev_requirements.txt \
1619
&& runDeps="$( \
@@ -28,6 +31,7 @@ RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >>/etc/apk/repositor
2831
bash \
2932
shadow \
3033
postgresql \
34+
openssl \
3135
&& mkdir -p /run/postgresql $PGDATA \
3236
&& chown -R postgres:postgres /run/postgresql $PGDATA \
3337
&& apk del .build-deps \

rootfs/api/serializers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Classes to serialize the RESTful representation of Drycc API models.
33
"""
44
import logging
5-
import json
65

76
from django.contrib.auth.models import User
87
from django.contrib.auth.forms import UserCreationForm

rootfs/api/settings/production.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import os.path
1313
import tempfile
1414
import ldap
15-
import base64
1615
import dj_database_url
1716

1817
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
@@ -359,11 +358,11 @@
359358
"OAUTH2_VALIDATOR_CLASS": "api.serializers.CustomOAuth2Validator",
360359
"PKCE_REQUIRED": False,
361360
"ALLOWED_REDIRECT_URI_SCHEMES": ["http", "https"],
362-
"ACCESS_TOKEN_EXPIRE_SECONDS": int(os.environ.get('ACCESS_TOKEN_EXPIRE_SECONDS', 30 * 86400)),
363-
"ID_TOKEN_EXPIRE_SECONDS": int(os.environ.get('ID_TOKEN_EXPIRE_SECONDS', 30 * 86400)),
364-
"AUTHORIZATION_CODE_EXPIRE_SECONDS": int(os.environ.get('AUTHORIZATION_CODE_EXPIRE_SECONDS', 600)),
365-
"CLIENT_SECRET_GENERATOR_LENGTH": int(os.environ.get('CLIENT_SECRET_GENERATOR_LENGTH', 64)),
366-
"REFRESH_TOKEN_EXPIRE_SECONDS": int(os.environ.get('REFRESH_TOKEN_EXPIRE_SECONDS', 60 * 86400)),
361+
"ACCESS_TOKEN_EXPIRE_SECONDS": int(os.environ.get('ACCESS_TOKEN_EXPIRE_SECONDS', 30 * 86400)), # noqa
362+
"ID_TOKEN_EXPIRE_SECONDS": int(os.environ.get('ID_TOKEN_EXPIRE_SECONDS', 30 * 86400)), # noqa
363+
"AUTHORIZATION_CODE_EXPIRE_SECONDS": int(os.environ.get('AUTHORIZATION_CODE_EXPIRE_SECONDS', 600)), # noqa
364+
"CLIENT_SECRET_GENERATOR_LENGTH": int(os.environ.get('CLIENT_SECRET_GENERATOR_LENGTH', 64)), # noqa
365+
"REFRESH_TOKEN_EXPIRE_SECONDS": int(os.environ.get('REFRESH_TOKEN_EXPIRE_SECONDS', 60 * 86400)), # noqa
367366
"ROTATE_REFRESH_TOKEN": True,
368367
"SCOPES": {
369368
"profile": "Profile",

rootfs/api/urls.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@
1414
re_path(r'accounts/', include('django.contrib.auth.urls')),
1515

1616
re_path(r'accounts/register/?$', RegisterView.as_view(), name='register'),
17-
re_path(r'accounts/activate/(?P<uidb64>.+)/(?P<token>.+)/?$', ActivateAccount.as_view(), name='activate_account'),
18-
re_path(r'accounts/register/done/?$', RegisterDoneView.as_view(), name='register_done'),
19-
re_path(r'accounts/activate/done/?$', ActivateAccountDoneView.as_view(), name='activate_account_done'),
20-
re_path(r'accounts/activate/fail/?$', ActivateAccountFailView.as_view(), name='activate_account_done'),
17+
re_path(r'accounts/activate/(?P<uidb64>.+)/(?P<token>.+)/?$',
18+
ActivateAccount.as_view(), name='activate_account'),
19+
re_path(r'accounts/register/done/?$', RegisterDoneView.as_view(),
20+
name='register_done'),
21+
re_path(r'accounts/activate/done/?$', ActivateAccountDoneView.as_view(),
22+
name='activate_account_done'),
23+
re_path(r'accounts/activate/fail/?$', ActivateAccountFailView.as_view(),
24+
name='activate_account_done'),
2125

22-
re_path(r'oauth/', include('oauth2_provider.urls', namespace='oauth2_provider')),
26+
re_path(r'oauth/',
27+
include('oauth2_provider.urls', namespace='oauth2_provider')),
2328

2429
re_path(r'users/?$', views.UserDetailView.as_view({'get': 'retrieve'})),
25-
re_path(r'users/emails/?$', views.UserEmailView.as_view({'get': 'retrieve'})),
30+
re_path(r'users/emails/?$',
31+
views.UserEmailView.as_view({'get': 'retrieve'})),
2632

2733
re_path(r'login/done/?$', LoginDoneView.as_view(), name='login_done'),
2834
]

0 commit comments

Comments
 (0)