Skip to content
Snippets Groups Projects
Verified Commit e3c466dc authored by Erwan Rouchet's avatar Erwan Rouchet
Browse files

Fix sorting of cryptography imports

parent 76a8438e
No related branches found
No related tags found
1 merge request!1902Vore Ponos server-side code
......@@ -8,4 +8,4 @@ line_length = 120
default_section=FIRSTPARTY
known_first_party = transkribus
known_third_party = SolrClient,bleach,boto3,botocore,corsheaders,django,django_admin_hstore_widget,django_rq,drf_spectacular,enumfields,gitlab,psycopg2,requests,responses,rest_framework,rq,setuptools,sqlparse,teklia_toolbox,tenacity,tripoli,yaml
known_third_party = SolrClient,bleach,boto3,botocore,cryptography,corsheaders,django,django_admin_hstore_widget,django_rq,drf_spectacular,enumfields,gitlab,psycopg2,requests,responses,rest_framework,rq,setuptools,sqlparse,teklia_toolbox,tenacity,tripoli,yaml
......@@ -7,12 +7,7 @@ from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.hashes import SHA256
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives.serialization import (
Encoding,
NoEncryption,
PrivateFormat,
load_pem_private_key,
)
from cryptography.hazmat.primitives.serialization import Encoding, NoEncryption, PrivateFormat, load_pem_private_key
from django.conf import settings
logger = logging.getLogger(__name__)
......
......@@ -7,6 +7,7 @@ from datetime import timedelta
from hashlib import sha256
from botocore.exceptions import ClientError
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.validators import MinLengthValidator, MinValueValidator, RegexValidator
......@@ -24,7 +25,6 @@ from arkindex.ponos.keys import gen_nonce
from arkindex.ponos.managers import TaskManager
from arkindex.ponos.recipe import parse_recipe, recipe_depth
from arkindex.ponos.validators import MaxValueValidator
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from rest_framework_simplejwt.tokens import RefreshToken
# Maximum allowed time until an agent is considered inactive since last request
......
......@@ -3,11 +3,7 @@ import base64
from cryptography.exceptions import UnsupportedAlgorithm
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.serialization import (
Encoding,
PublicFormat,
load_pem_public_key,
)
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat, load_pem_public_key
from enumfields import Enum
from rest_framework import serializers
......
......@@ -5,6 +5,11 @@ import uuid
from io import BytesIO
from unittest.mock import call, patch
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.hashes import SHA256
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat
from django.conf import settings
from django.contrib.auth.models import User
from django.test import override_settings
......@@ -17,11 +22,6 @@ from arkindex.ponos.api import timezone as api_tz
from arkindex.ponos.authentication import AgentUser
from arkindex.ponos.models import FINAL_STATES, GPU, Agent, Farm, Secret, State, Task, Workflow, encrypt
from arkindex.project.tools import build_public_key
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.hashes import SHA256
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat
RECIPE = """
env:
......
import os
import tempfile
import cryptography
from django.test import TestCase, override_settings
import cryptography
from arkindex.ponos.keys import gen_private_key, load_private_key
BAD_KEY = """-----BEGIN RSA PRIVATE KEY-----
......
from collections.abc import Iterable, Iterator, Sized
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat
from django.db.models import Aggregate, CharField, Func
from django.db.models.expressions import BaseExpression, OrderByList
from django.urls import reverse
from rest_framework import serializers
from arkindex.documents.models import Element, ElementPath
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat
def build_absolute_url(element, request, name, id_argument='pk', **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment