Skip to content

Conversation

@MaxLikesCode
Copy link

@MaxLikesCode MaxLikesCode commented Jan 12, 2025

The sdk is currently throwing a Type error when trying to call list_secrets or get_secret_by_name.

TypeError: BaseSecret.__init__() got an unexpected keyword argument 'secretMetadata'.

It also throws an APIError when trying to call create_secret_by_name or update_secret_by_name.

raise APIError( infisical_sdk.infisical_requests.APIError: [{'code': 'invalid_type', 'expected': 'string', 'received': 'undefined', 'path': ['secretValue'], 'message': 'Required'}] (Status: 422)

This change fixes the error.

…etadata

The sdk is currently throwing a TypeError (TypeError: BaseSecret.__init__() got an unexpected keyword argument 'secretMetadata'). This change fixes it.
@Divyansh0811
Copy link

Hey @MaxLikesCode, I believe it'd be good if we did not remove the metadata field and replace it with the secretMetadata. If we see the API response, we get both the fields—metadata and secretMetadata!

Adding secretMetadata would do the job instead of replacing it, correct me if I am wrong, Cheers!

- Add metadata back to BaseSecret
- Add SecretMetadata pydantic model
- Add secretMetadata to BaseSecret
@MaxLikesCode
Copy link
Author

Hey @MaxLikesCode, I believe it'd be good if we did not remove the metadata field and replace it with the secretMetadata. If we see the API response, we get both the fields—metadata and secretMetadata!

Adding secretMetadata would do the job instead of replacing it, correct me if I am wrong, Cheers!

Yeah, you were correct. I added metadata back to the BaseSecret and created a new pydantic model for the secretMetadata. That should fix it. Let me know if you find something else.

@MaxLikesCode
Copy link
Author

Installed the package with the changes and it seems to work fine now.

@rlordcardano
Copy link

Great - how do we get this reviewed, merged and released?
There are quite a few people waiting for a fix of #15.

@varonix0
Copy link
Member

Resolved in #18

@varonix0 varonix0 closed this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants