Open soobinbhan opened 6 days ago
Hi @soobinbhan! Apologies for the persisting issue here, we're applying some local fixes but also working on some upstream adjustments that should help address this long term. Would you mind updating to the most recently released version and see if there are any changes, particularly to the OAuth verification strategy? You can see the update to the referenced file here.
@logangingerich Thanks for the update. I'm running into another validation issue:
{ "detail": "User not found: 4 validation errors for Unmarshaller body.email_addresses.0.verification.Otp.attempts Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.8/v/int_type body.email_addresses.0.verification.Otp.expire_at Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.8/v/int_type body.email_addresses.0.verification.Admin.strategy Input should be 'admin' [type=enum, input_value='from_oauth_microsoft', input_type=str] For further information visit https://errors.pydantic.dev/2.8/v/enum body.email_addresses.0.verification.Oauth.expire_at Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.8/v/int_type" }
Looks like the following line needs to be added:
class VerificationStrategy(str, Enum):
ADMIN = "admin"
**FROM_OAUTH_MICROSOFT = "from_oauth_microsoft"**
After adding this line, I can fetch users as expected.
I am getting this also
s = Clerk(bearer_auth=CLERK_API_KEY) res = s.users.get(user_id=user_id)
line 212, in init
validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 4 validation errors for Unmarshaller
body.email_addresses.0.verification.Otp.attempts
Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.9/v/int_type
body.email_addresses.0.verification.Otp.expire_at
Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.9/v/int_type
body.email_addresses.0.verification.Admin.strategy
Input should be 'admin' [type=enum, input_value='from_oauth_google', input_type=str]
For further information visit https://errors.pydantic.dev/2.9/v/enum
body.email_addresses.0.verification.Oauth.expire_at
Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.9/v/int_type
pydantic_core._pydantic_core.ValidationError: 4 validation errors for Unmarshaller body.email_addresses.0.verification.Otp.attempts Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.9/v/int_type body.email_addresses.0.verification.Otp.expire_at Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.9/v/int_type body.email_addresses.0.verification.Admin.strategy Input should be 'admin' [type=enum, input_value='from_oauth_google', input_type=str] For further information visit https://errors.pydantic.dev/2.9/v/enum body.email_addresses.0.verification.Oauth.expire_at Input should be a valid integer [type=int_type, input_value=None, input_type=NoneType] For further information visit https://errors.pydantic.dev/2.9/v/int_type
seems you need to set.
class OtpTypedDict(TypedDict):
status: VerificationStatus
strategy: Strategy
attempts: None
expire_at: None
class Otp(BaseModel):
status: VerificationStatus
strategy: Strategy
attempts: None
expire_at: None
if I do as below: a = res.email_addresses why is it a list of EmailAddress Object?
Issue: Pydantic failure from #27 persists when calling clerk_client.users.list()
https://github.com/clerk/clerk-sdk-python/blob/a6c5d4efe16d30a626ee70ced55082617468254d/src/clerk_backend_api/models/emailaddress.py#L25
Appears that OauthVerificationStrategy needs FROM_OAUTH_MICROSOFT="from_oauth_microsoft"
I'm not sure why there are other validation failures.