Title: Issue creating objectstorage access key without an expiry · Issue #809 · stackitcloud/stackit-sdk-python · GitHub
Open Graph Title: Issue creating objectstorage access key without an expiry · Issue #809 · stackitcloud/stackit-sdk-python
X Title: Issue creating objectstorage access key without an expiry · Issue #809 · stackitcloud/stackit-sdk-python
Description: Hello, I want to create a access key without an expiry. But I keep running into an pydantic problem. I am running this code: config = Configuration() client = DefaultApi(config) name = "abc" project_id = os.getenv("OS_PROJECT_NAME") cred...
Open Graph Description: Hello, I want to create a access key without an expiry. But I keep running into an pydantic problem. I am running this code: config = Configuration() client = DefaultApi(config) name = "abc" projec...
X Description: Hello, I want to create a access key without an expiry. But I keep running into an pydantic problem. I am running this code: config = Configuration() client = DefaultApi(config) name = "abc&qu...
Opengraph URL: https://github.com/stackitcloud/stackit-sdk-python/issues/809
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Issue creating objectstorage access key without an expiry","articleBody":"Hello,\n\nI want to create a access key without an expiry. But I keep running into an pydantic problem.\n\nI am running this code:\n\n```python\n config = Configuration()\n client = DefaultApi(config)\n name = \"abc\"\n project_id = os.getenv(\"OS_PROJECT_NAME\")\n cred_grp_resp = client.create_credentials_group(\n project_id, \"eu01\", CreateCredentialsGroupPayload(displayName=name)\n )\n acc_key_resp = client.create_access_key(\n project_id,\n \"eu01\",\n CreateAccessKeyPayload(),\n cred_grp_resp.credentials_group.credentials_group_id,\n )\n```\n\nThe error I am getting is:\n\n```\n File \"/app/pylfc/s3.py\", line 196, in create_bucket_credentials\n acc_key_resp = client.create_access_key(\n File \"/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_validate_call.py\", line 39, in wrapper_function\n return wrapper(*args, **kwargs)\n File \"/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_validate_call.py\", line 136, in __call__\n res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/api/default_api.py\", line 139, in create_access_key\n return self.api_client.response_deserialize(\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/api_client.py\", line 275, in response_deserialize\n return_data = self.deserialize(response_text, response_type, content_type)\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/api_client.py\", line 363, in deserialize\n return self.__deserialize(data, response_type)\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/api_client.py\", line 408, in __deserialize\n return self.__deserialize_model(data, klass)\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/api_client.py\", line 626, in __deserialize_model\n return klass.from_dict(data)\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/models/create_access_key_response.py\", line 87, in from_dict\n _obj = cls.model_validate(\n File \"/usr/local/lib/python3.10/dist-packages/pydantic/main.py\", line 693, in model_validate\n return cls.__pydantic_validator__.validate_python(\npydantic_core._pydantic_core.ValidationError: 1 validation error for CreateAccessKeyResponse\nexpires\n Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]\n For further information visit https://errors.pydantic.dev/2.11/v/string_type\n```\n\nI seems the \"CreateAccessKeyPayload\" accepts an \"None\" expiry date, which is allowed looing at the api docs, but the CreateAccessKeyResponse requires it the field to be a string and not None.\n\nUsing the same code but setting an \"expires\" allows me to create the key:\n\n```python\n acc_key_resp = client.create_access_key(\n project_id,\n \"eu01\",\n CreateAccessKeyPayload(expires=datetime(2026, 1, 1)),\n cred_grp_resp.credentials_group.credentials_group_id,\n )\n```\n\nAsking for a fix. Kind regards, Sebastian","author":{"url":"https://github.com/sebastianelsner","@type":"Person","name":"sebastianelsner"},"datePublished":"2025-03-28T17:56:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/809/stackit-sdk-python/issues/809"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:99b10ce4-8066-c964-6da3-fb52130eed85 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B76A:9E0F9:6DEE23:9ADD2D:69835515 |
| html-safe-nonce | 125114e90123a38ac43672999e1fa7363cdc672968f92c7aae4b5314e56c370e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzZBOjlFMEY5OjZERUUyMzo5QUREMkQ6Njk4MzU1MTUiLCJ2aXNpdG9yX2lkIjoiNTc5Mzk4NzM1MDQyNDAxNTU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | da783fccf7b3d78821dd6a54ea943bf1216f7f48a29b518650378a8aff7a18c6 |
| hovercard-subject-tag | issue:2956821661 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/stackitcloud/stackit-sdk-python/809/issue_layout |
| twitter:image | https://opengraph.githubassets.com/09c9844c92c232a7e90846880a582e7baf6cb08921df25c1e14264ed9aee2f14/stackitcloud/stackit-sdk-python/issues/809 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/09c9844c92c232a7e90846880a582e7baf6cb08921df25c1e14264ed9aee2f14/stackitcloud/stackit-sdk-python/issues/809 |
| og:image:alt | Hello, I want to create a access key without an expiry. But I keep running into an pydantic problem. I am running this code: config = Configuration() client = DefaultApi(config) name = "abc" projec... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sebastianelsner |
| hostname | github.com |
| expected-hostname | github.com |
| None | ab9e68a8aa0e5ce51016e7614bd87e14762cbdbb53b8f7bdc413f61d6c4e97c5 |
| turbo-cache-control | no-preview |
| go-import | github.com/stackitcloud/stackit-sdk-python git https://github.com/stackitcloud/stackit-sdk-python.git |
| octolytics-dimension-user_id | 55577607 |
| octolytics-dimension-user_login | stackitcloud |
| octolytics-dimension-repository_id | 872376182 |
| octolytics-dimension-repository_nwo | stackitcloud/stackit-sdk-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 872376182 |
| octolytics-dimension-repository_network_root_nwo | stackitcloud/stackit-sdk-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 79b9e26b080c910a8902907a207a553d3c1c5eff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width