Skip to content

Commit

Permalink
Merge branch 'quentin/deprecateOldOidcFlow' into 'master'
Browse files Browse the repository at this point in the history
chore(core): deprecate old OIDC flow

See merge request TankerHQ/sdk-python!311
  • Loading branch information
quentinvernot committed Jun 12, 2024
2 parents 687bdf6 + 8434d0e commit 5834f1f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tankersdk/tanker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import os
import warnings
import weakref
from enum import Enum, IntEnum
from typing import Any, List, Optional, Union, cast
Expand Down Expand Up @@ -103,6 +104,12 @@ class OidcIdTokenVerification(Verification):
method_type = VerificationMethodType.OIDC_ID_TOKEN

def __init__(self, oidc_id_token: str):
warnings.warn(
"The entire OIDC flow has been reworked in version 4.2.0, "
'"OidcIdTokenVerification" has been deprecated as a result, '
'use "OidcAuthorizationCodeVerification" instead',
DeprecationWarning,
)
self.oidc_id_token = oidc_id_token


Expand Down Expand Up @@ -820,6 +827,12 @@ async def stop(self) -> None:

async def create_oidc_nonce(self) -> str:
"""Create a nonce to use in oidc authorization code flow"""
warnings.warn(
"The entire OIDC flow has been reworked in version 4.2.0, "
'method "create_oidc_nonce" has been deprecated as a result',
DeprecationWarning,
)

c_future = tankerlib.tanker_create_oidc_nonce(self.c_tanker)
c_voidp = await ffihelpers.handle_tanker_future(c_future)
c_str = ffi.cast("char*", c_voidp)
Expand All @@ -835,6 +848,12 @@ async def _set_oidc_test_nonce(self, nonce: str) -> None:

async def set_oidc_test_nonce(self, nonce: str) -> None:
"""Set the oidc nonce to use during the next verification operation"""
warnings.warn(
"The entire OIDC flow has been reworked in version 4.2.0, "
'method "set_oidc_test_nonce" has been deprecated as a result',
DeprecationWarning,
)

await self._set_oidc_test_nonce(nonce)

async def encrypt(
Expand Down

0 comments on commit 5834f1f

Please sign in to comment.