Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 57898b2f

Přidáno uživatelem Stanislav Král před asi 4 roky(ů)

Re #8472 - Changed access modifier of subject_to_param method to private (was protected previously) and added docstring to it

Zobrazit rozdíly:

proj/services/cryptography.py
12 12
class CryptographyService:
13 13

  
14 14
    @staticmethod
15
    def _subject_to_param_format(subject):
15
    def __subject_to_param_format(subject):
16
        """
17
        Converts the given subject to a dictionary containing openssl field names mapped to subject's fields
18
        :param subject: subject to be converted
19
        :return: a dictionary containing openssl field names mapped to subject's fields
20
        """
16 21
        subj_dict = {}
17 22
        if subject.common_name is not None:
18 23
            subj_dict["CN"] = subject.common_name
......
96 101
        assert key is not None
97 102
        assert subject is not None
98 103

  
99
        subj = self._subject_to_param_format(subject)
104
        subj = self.__subject_to_param_format(subject)
100 105

  
101 106
        with TemporaryFile("openssl.conf", config) as conf_path:
102 107
            args = ["req", "-x509", "-new", "-subj", subj,
......
126 131
        :return: string containing the generated certificate signing request in PEM format
127 132
        """
128 133

  
129
        subj_param = self._subject_to_param_format(subject)
134
        subj_param = self.__subject_to_param_format(subject)
130 135

  
131 136
        args = ["req", "-new", "-subj", subj_param, "-key", "-"]
132 137

  

Také k dispozici: Unified diff