Comments (7)
@cmc333333 do u have async
and await
?
shouldn't it be
async with Client() as client:
assignment, _, _ = await client.get_application_group_assignment(APP_ID, GROUP_ID)
# should be a no-op:
await client.create_application_group_assignment(APP_ID, GROUP_ID, assignment)
from okta-sdk-python.
Sorry, yes, please assume there was an await
in there. We're converting it all to synchronous versions.
Also, as written, I think the call would error out rather than silently fail (Okta rejects the camelCase
version of the field). It looks like both UserProfile
and GroupProfile
have some logic to account for this problem, so it could just be App profiles that are the problem?
from okta-sdk-python.
We're converting it all to synchronous versions
how?
It looks like both UserProfile and GroupProfile have some logic to account for this problem
where?
here's my repro code
import okta.client
import asyncio
APP_ID = '0oa...'
GROUP_ID = '00g...'
async def main():
async with okta.client.Client() as client:
assignment, _, _ = await client.get_application_group_assignment(APP_ID, GROUP_ID)
print(assignment.profile)
await client.create_application_group_assignment(APP_ID, GROUP_ID, assignment)
asyncio.run(main())
i have attributes snake_case
and camelCase
, but the print shows {'camelCase': 'perl', 'snakeCase': 'python'}
(which is wrong)
if i set logging enabled to true, i get
okta-sdk-python - http_client - ERROR -
{'message': "Okta HTTP 400 E0000001 Api validation failed: Setproperty\nProperty 'snakeCase' not found"}
it sounds like the whole snake_case to camelCase conversion shouldn't be done (not that it should be converted and then converted back again)
from okta-sdk-python.
how?
async_to_sync
. Not super related to the problem at hand.
where?
okta-sdk-python/okta/models/group_profile.py
Lines 45 to 49 in d896f65
okta-sdk-python/okta/models/user_profile.py
Lines 132 to 136 in d896f65
I've not dug in enough to understand how that logic's injected, though -- the call to form_response_body
is probably before then.
Okta HTTP 400 E0000001
Exactly. I think there are weird edge cases where setting snake_case
could override snakeCase
and lead to data loss, but the important thing is that the calls aren't doing the "right thing".
it sounds like the whole snake_case to camelCase conversion shouldn't be done
That seems like a fine solution to me! We're working around this by using the response object (second element of the return value) directly.
from okta-sdk-python.
Not super related to the problem at hand.
yes, and no. i can't repro your code without async and await (i'm not going to use a2s). a2s might have bugs, too. i'd recommend posting code just using the sdk
(i'll take a look at the rest of your response and reply)
from okta-sdk-python.
I'm glad you were able to see through my buggy code to the underlying problem.
from okta-sdk-python.
ooh, i can print(error)
. i've never done that before
async def main():
async with okta.client.Client() as client:
assignment, response, error = await client.get_application_group_assignment(APP_ID, GROUP_ID)
print(assignment.profile)
# should be a no-op:
assignment, response, error = await client.create_application_group_assignment(APP_ID, GROUP_ID, assignment)
print(error)
i've looked the sdk code. still haven't found anything, but this is promising
okta-sdk-python/okta/api_response.py
Lines 136 to 144 in d896f65
from okta-sdk-python.
Related Issues (20)
- error: client_assertion token has an expiration too far into the future HOT 1
- `forgot_password_generate_one_time_token` not-functional in private key mode HOT 1
- POST /token in body, not in url
- UserFactorClient.list_factors always return null for "result" HOT 4
- [CVE-2024-23342] python-jose include by default python-ecdsa HOT 7
- Standardize configuration env vars with terraform provider
- The update_user method doesn't work reliably with string arrays
- Request Timeout cannot be set via an environment variable
- Pagination in get_logs not respecting until query parameter HOT 2
- okta/api_client.py — APIClient::form_response_body — AttributeError: 'str' object has no attribute 'items'
- vulnerability in indirect import of ecdsa library HOT 2
- Bug: "Okta direct auth API grants" are not valid OAuthGrantType HOT 3
- Missing headers throws 400 Bad request when call forgot_password_generate_one_time_token method
- [Sdk v3] Evaluate event systems HOT 1
- [Sdk v3] Begin v3 branch
- [Sdk v3] Diagram injectable modules HOT 1
- [Sdk v3] Modify templates to enable custom request and response processing
- [Sdk v3] Add/Modify unit tests
- [Sdk v3] Define desired usage patterns
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from okta-sdk-python.