From b775f2788c530fccb952b21d8b33f596ed761a7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Nov 2020 10:26:26 +0100 Subject: [PATCH] build(deps): bump channels from 2.4.0 to 3.0.0 (#309) * build(deps): bump channels from 2.4.0 to 3.0.0 Bumps [channels](https://github.com/django/channels) from 2.4.0 to 3.0.0. - [Release notes](https://github.com/django/channels/releases) - [Changelog](https://github.com/django/channels/blob/master/CHANGELOG.txt) - [Commits](https://github.com/django/channels/compare/2.4.0...3.0.0) Signed-off-by: dependabot[bot] * root: update for channels 3 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jens Langhammer --- Pipfile.lock | 25 +++++++------ lifecycle/gunicorn.conf.py | 3 ++ passbook/root/asgi.py | 4 +- passbook/root/routing.py | 4 +- swagger.yaml | 77 ++++++++++++++++++++++++++++++++++---- 5 files changed, 90 insertions(+), 23 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 873b91df7..2abef4615 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -152,11 +152,11 @@ }, "channels": { "hashes": [ - "sha256:08e756406d7165cb32f6fc3090c0643f41ca9f7e0f7fada0b31194662f20f414", - "sha256:80a5ad1962ae039a3dcc0a5cb5212413e66e2f11ad9e9db8004834436daf3400" + "sha256:af2206de0b76b3209fe8cc71b4a7c2975fee97ed975313d7c098414af060c1da", + "sha256:fd3596f252e8415523e2b33bf76363127326c18fb338a7b1191a6ff52e7d3f0f" ], "index": "pypi", - "version": "==2.4.0" + "version": "==3.0.0" }, "channels-redis": { "hashes": [ @@ -251,10 +251,10 @@ }, "daphne": { "hashes": [ - "sha256:1ca46d7419103958bbc9576fb7ba3b25b053006e22058bc97084ee1a7d44f4ba", - "sha256:aa64840015709bbc9daa3c4464a4a4d437937d6cda10a9b51e913eb319272553" + "sha256:60856f7efa0b1e1b969efa074e8698bd09de4713ecc06e6a4d19d04c66c4a3bd", + "sha256:b43e70d74ff832a634ff6c92badd208824e4530e08b340116517e5aad0aca774" ], - "version": "==2.5.0" + "version": "==3.0.0" }, "defusedxml": { "hashes": [ @@ -574,6 +574,7 @@ }, "lxml": { "hashes": [ + "sha256:098fb713b31050463751dcc694878e1d39f316b86366fb9fe3fbbe5396ac9fab", "sha256:0e89f5d422988c65e6936e4ec0fe54d6f73f3128c80eb7ecc3b87f595523607b", "sha256:189ad47203e846a7a4951c17694d845b6ade7917c47c64b29b86526eefc3adf5", "sha256:1d87936cb5801c557f3e981c9c193861264c01209cb3ad0964a16310ca1b3301", @@ -895,10 +896,10 @@ }, "pytz": { "hashes": [ - "sha256:a494d53b6d39c3c6e44c3bec237336e14305e4f29bbf800b599253057fbb79ed", - "sha256:c35965d010ce31b23eeb663ed3cc8c906275d6be1a34393a1d73a41febf4a048" + "sha256:3e6b7dd2d1e0a59084bcee14a17af60c5c562cdc16d828e8eba2e683d3a7e268", + "sha256:5c55e189b682d420be27c6995ba6edce0c0a77dd67bfbe2ae6607134d5851ffd" ], - "version": "==2020.1" + "version": "==2020.4" }, "pyyaml": { "hashes": [ @@ -1593,10 +1594,10 @@ }, "pytz": { "hashes": [ - "sha256:a494d53b6d39c3c6e44c3bec237336e14305e4f29bbf800b599253057fbb79ed", - "sha256:c35965d010ce31b23eeb663ed3cc8c906275d6be1a34393a1d73a41febf4a048" + "sha256:3e6b7dd2d1e0a59084bcee14a17af60c5c562cdc16d828e8eba2e683d3a7e268", + "sha256:5c55e189b682d420be27c6995ba6edce0c0a77dd67bfbe2ae6607134d5851ffd" ], - "version": "==2020.1" + "version": "==2020.4" }, "pyyaml": { "hashes": [ diff --git a/lifecycle/gunicorn.conf.py b/lifecycle/gunicorn.conf.py index 729e6353d..b8ea3fcec 100644 --- a/lifecycle/gunicorn.conf.py +++ b/lifecycle/gunicorn.conf.py @@ -1,4 +1,5 @@ """Gunicorn config""" +import warnings from multiprocessing import cpu_count from pathlib import Path @@ -49,3 +50,5 @@ if Path("/var/run/secrets/kubernetes.io").exists(): else: worker = cpu_count() * 2 + 1 threads = 4 + +warnings.simplefilter("once") diff --git a/passbook/root/asgi.py b/passbook/root/asgi.py index fa37a7e17..92b235b1a 100644 --- a/passbook/root/asgi.py +++ b/passbook/root/asgi.py @@ -13,8 +13,8 @@ from typing import Any, ByteString, Dict import django from asgiref.compatibility import guarantee_single_callable -from channels.routing import get_default_application from defusedxml import defuse_stdlib +from django.core.asgi import get_asgi_application from sentry_sdk.integrations.asgi import SentryAsgiMiddleware from structlog import get_logger @@ -129,5 +129,5 @@ class ASGILogger: application = ASGILogger( - guarantee_single_callable(SentryAsgiMiddleware(get_default_application())) + guarantee_single_callable(SentryAsgiMiddleware(get_asgi_application())) ) diff --git a/passbook/root/routing.py b/passbook/root/routing.py index 003e5cdc8..8cdeeed39 100644 --- a/passbook/root/routing.py +++ b/passbook/root/routing.py @@ -7,6 +7,8 @@ from passbook.outposts.channels import OutpostConsumer application = ProtocolTypeRouter( { # (http->django views is added by default) - "websocket": URLRouter([path("ws/outpost//", OutpostConsumer)]), + "websocket": URLRouter( + [path("ws/outpost//", OutpostConsumer.as_asgi())] + ), } ) diff --git a/swagger.yaml b/swagger.yaml index d83c14117..8c45e0c12 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -26,8 +26,9 @@ paths: parameters: [] responses: '200': - description: '' + description: Overview View schema: + description: '' type: array items: $ref: '#/definitions/AdministrationMetrics' @@ -41,8 +42,9 @@ paths: parameters: [] responses: '200': - description: '' + description: Overview View schema: + description: '' type: array items: $ref: '#/definitions/AdministrationOverview' @@ -56,8 +58,9 @@ paths: parameters: [] responses: '200': - description: '' + description: Serialize TaskInfo and TaskResult schema: + description: '' type: array items: $ref: '#/definitions/Task' @@ -3341,8 +3344,9 @@ paths: parameters: [] responses: '200': - description: '' + description: Serialize Django Message into DRF Object schema: + description: '' type: array items: $ref: '#/definitions/Message' @@ -6031,6 +6035,7 @@ paths: format: uuid definitions: AdministrationMetrics: + description: Overview View type: object properties: logins_per_1h: @@ -6042,6 +6047,7 @@ definitions: type: string readOnly: true AdministrationOverview: + description: Overview View type: object properties: version: @@ -6073,6 +6079,7 @@ definitions: type: integer readOnly: true Task: + description: Serialize TaskInfo and TaskResult required: - task_name - task_description @@ -6097,10 +6104,12 @@ definitions: title: Status type: integer messages: + description: '' type: array items: type: string Event: + description: Event Serializer required: - action - app @@ -6153,6 +6162,7 @@ definitions: format: date-time readOnly: true Application: + description: Application Serializer required: - name - slug @@ -6202,6 +6212,7 @@ definitions: readOnly: true uniqueItems: true Group: + description: Group Serializer required: - name - parent @@ -6235,6 +6246,7 @@ definitions: title: Attributes type: object Token: + description: Token Serializer required: - identifier - user @@ -6266,6 +6278,7 @@ definitions: title: Description type: string User: + description: User Serializer required: - username - name @@ -6298,6 +6311,7 @@ definitions: format: email maxLength: 254 CertificateKeyPair: + description: CertificateKeyPair Serializer required: - name - certificate_data @@ -6323,6 +6337,7 @@ definitions: for encryption. type: string FlowStageBinding: + description: FlowStageBinding Serializer required: - target - stage @@ -6364,6 +6379,7 @@ definitions: readOnly: true uniqueItems: true Flow: + description: Flow Serializer required: - name - slug @@ -6417,6 +6433,7 @@ definitions: readOnly: true uniqueItems: true Outpost: + description: Outpost Serializer required: - name - providers @@ -6442,7 +6459,7 @@ definitions: type: object OpenIDConnectConfiguration: title: Oidc configuration - description: Embed OpenID Connect provider information + description: rest_framework Serializer for OIDC Configuration required: - issuer - authorization_endpoint @@ -6486,26 +6503,31 @@ definitions: type: string minLength: 1 response_types_supported: + description: '' type: array items: type: string minLength: 1 id_token_signing_alg_values_supported: + description: '' type: array items: type: string minLength: 1 subject_types_supported: + description: '' type: array items: type: string minLength: 1 token_endpoint_auth_methods_supported: + description: '' type: array items: type: string minLength: 1 ProxyOutpostConfig: + description: ProxyProvider Serializer required: - name - internal_host @@ -6573,6 +6595,7 @@ definitions: Header. If not set, the user's Email address is used. type: string Policy: + description: Policy Serializer type: object properties: pk: @@ -6589,6 +6612,7 @@ definitions: type: string readOnly: true PolicyBinding: + description: PolicyBinding Serializer required: - policy - target @@ -6623,6 +6647,7 @@ definitions: maximum: 2147483647 minimum: -2147483648 DummyPolicy: + description: Dummy Policy Serializer type: object properties: pk: @@ -6648,6 +6673,7 @@ definitions: maximum: 2147483647 minimum: -2147483648 ExpressionPolicy: + description: Group Membership Policy Serializer required: - expression type: object @@ -6666,6 +6692,7 @@ definitions: type: string minLength: 1 GroupMembershipPolicy: + description: Group Membership Policy Serializer type: object properties: pk: @@ -6683,6 +6710,7 @@ definitions: format: uuid x-nullable: true HaveIBeenPwendPolicy: + description: Have I Been Pwned Policy Serializer type: object properties: pk: @@ -6705,6 +6733,7 @@ definitions: maximum: 2147483647 minimum: -2147483648 PasswordPolicy: + description: Password Policy Serializer required: - error_message type: object @@ -6752,6 +6781,7 @@ definitions: type: string minLength: 1 PasswordExpiryPolicy: + description: Password Expiry Policy Serializer required: - days type: object @@ -6774,6 +6804,7 @@ definitions: title: Deny only type: boolean ReputationPolicy: + description: Reputation Policy Serializer type: object properties: pk: @@ -6797,6 +6828,7 @@ definitions: maximum: 2147483647 minimum: -2147483648 PropertyMapping: + description: PropertyMapping Serializer required: - name - expression @@ -6820,6 +6852,7 @@ definitions: type: string readOnly: true LDAPPropertyMapping: + description: LDAP PropertyMapping Serializer required: - name - expression @@ -6844,6 +6877,7 @@ definitions: type: string minLength: 1 SAMLPropertyMapping: + description: SAMLPropertyMapping Serializer required: - name - saml_name @@ -6872,6 +6906,7 @@ definitions: type: string minLength: 1 ScopeMapping: + description: ScopeMapping Serializer required: - name - scope_name @@ -6902,6 +6937,7 @@ definitions: type: string minLength: 1 Provider: + description: Provider Serializer required: - name - authorization_flow @@ -6931,6 +6967,7 @@ definitions: type: string readOnly: true OAuth2Provider: + description: OAuth2Provider Serializer required: - name - authorization_flow @@ -7021,6 +7058,7 @@ definitions: format: uuid uniqueItems: true ProxyProvider: + description: ProxyProvider Serializer required: - name - internal_host @@ -7073,6 +7111,7 @@ definitions: Header. If not set, the user's Email address is used. type: string SAMLProvider: + description: SAMLProvider Serializer required: - name - acs_url @@ -7152,6 +7191,7 @@ definitions: the Certificate selected in `Singing Keypair`. type: boolean Message: + description: Serialize Django Message into DRF Object type: object properties: message: @@ -7175,6 +7215,7 @@ definitions: type: string readOnly: true Source: + description: Source Serializer required: - name - slug @@ -7218,6 +7259,7 @@ definitions: type: string readOnly: true LDAPSource: + description: LDAP Source Serializer required: - name - slug @@ -7330,6 +7372,7 @@ definitions: format: uuid uniqueItems: true OAuthSource: + description: OAuth Source Serializer required: - name - slug @@ -7412,6 +7455,7 @@ definitions: type: string minLength: 1 SAMLSource: + description: SAMLSource Serializer required: - name - slug @@ -7502,6 +7546,7 @@ definitions: type: string format: uuid Stage: + description: Stage Serializer required: - name type: object @@ -7524,6 +7569,7 @@ definitions: type: string readOnly: true CaptchaStage: + description: CaptchaStage Serializer required: - name - public_key @@ -7550,6 +7596,7 @@ definitions: type: string minLength: 1 ConsentStage: + description: ConsentStage Serializer required: - name type: object @@ -7576,6 +7623,7 @@ definitions: type: string minLength: 1 DummyStage: + description: DummyStage Serializer required: - name type: object @@ -7590,6 +7638,7 @@ definitions: type: string minLength: 1 EmailStage: + description: EmailStage Serializer required: - name type: object @@ -7652,6 +7701,7 @@ definitions: - stages/email/for_email/password_reset.html - stages/email/for_email/account_confirmation.html IdentificationStage: + description: IdentificationStage Serializer required: - name - user_fields @@ -7668,8 +7718,7 @@ definitions: type: string minLength: 1 user_fields: - description: Fields of the user object to match against. (Hold shift to select - multiple options) + description: '' type: array items: title: User fields @@ -7702,6 +7751,7 @@ definitions: format: uuid x-nullable: true InvitationStage: + description: InvitationStage Serializer required: - name type: object @@ -7722,6 +7772,7 @@ definitions: no invitation is given. type: boolean Invitation: + description: Invitation Serializer type: object properties: pk: @@ -7738,6 +7789,7 @@ definitions: title: Fixed data type: object OTPStaticStage: + description: OTPStaticStage Serializer required: - name type: object @@ -7764,6 +7816,7 @@ definitions: maximum: 2147483647 minimum: -2147483648 OTPTimeStage: + description: OTPTimeStage Serializer required: - name - digits @@ -7792,6 +7845,7 @@ definitions: - 6 - 8 OTPValidateStage: + description: OTPValidateStage Serializer required: - name type: object @@ -7806,6 +7860,7 @@ definitions: type: string minLength: 1 PasswordStage: + description: PasswordStage Serializer required: - name - backends @@ -7821,7 +7876,7 @@ definitions: type: string minLength: 1 backends: - description: Selection of backends to test the password against. + description: '' type: array items: title: Backends @@ -7842,6 +7897,7 @@ definitions: maximum: 2147483647 minimum: -2147483648 Prompt: + description: Prompt Serializer required: - field_key - label @@ -7892,6 +7948,7 @@ definitions: maximum: 2147483647 minimum: -2147483648 PromptStage: + description: PromptStage Serializer required: - name - fields @@ -7919,6 +7976,7 @@ definitions: format: uuid uniqueItems: true UserDeleteStage: + description: UserDeleteStage Serializer required: - name type: object @@ -7933,6 +7991,7 @@ definitions: type: string minLength: 1 UserLoginStage: + description: UserLoginStage Serializer required: - name type: object @@ -7953,6 +8012,7 @@ definitions: type: string minLength: 1 UserLogoutStage: + description: UserLogoutStage Serializer required: - name type: object @@ -7967,6 +8027,7 @@ definitions: type: string minLength: 1 UserWriteStage: + description: UserWriteStage Serializer required: - name type: object