Projet

Général

Profil

0001-auth_oidc-adapt-to-be-compatible-with-jwcrypto-1.patch

Benjamin Dauvergne, 21 juin 2022 13:22

Télécharger (1,4 ko)

Voir les différences:

Subject: [PATCH 1/2] auth_oidc: adapt to be compatible with jwcrypto<1

 src/authentic2_auth_oidc/models.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
src/authentic2_auth_oidc/models.py
155 155
                    _('Provider signature method is %s yet no jwkset was provided.')
156 156
                    % key_sig_mapping[self.idtoken_algo]
157 157
                )
158

  
159
            if not any([key.get('kty', None) == key_sig_mapping[self.idtoken_algo] for key in self.jwkset]):
158
            # verify that a key is available for the chosen algorithm
159
            for key in self.jwkset:
160
                # compatibility with jwcrypto < 1
161
                key_type = key.get('kty', None) if isinstance(key, dict) else key.key_type
162
                if key_type == key_sig_mapping[self.idtoken_algo]:
163
                    break
164
            else:
160 165
                raise ValidationError(
161 166
                    _(
162 167
                        'Provider signature method is %s yet the provided jwkset does not contain any such key type.'
163
-