Skip to content

feat: add v5-custom-fields resource type support#77

Closed
shsketch wants to merge 1 commit intopassbolt:v5from
shsketch:feat/v5-custom-fields
Closed

feat: add v5-custom-fields resource type support#77
shsketch wants to merge 1 commit intopassbolt:v5from
shsketch:feat/v5-custom-fields

Conversation

@shsketch
Copy link

Summary

  • Add CustomField struct for shared custom field item representation (used in both metadata and secret data)
  • Add SecretDataTypeV5CustomFields and ResourceMetadataTypeV5CustomFields types matching the Passbolt v5.3+ schema
  • Add fallback JSON schema for v5-custom-fields in ResourceSchemas
  • Add v5-custom-fields case in GetResourceFromDataWithOptions to decrypt metadata and extract password from the first custom field of type "password"

Context

Passbolt v5.3+ introduced the v5-custom-fields resource type (slug: v5-custom-fields). Without this patch, any resource using this type causes GetResource / GetResourceFromData to return ErrUnsupportedResourceType.

Test plan

  • Verify v5-custom-fields resources can be retrieved via GetResource
  • Verify metadata fields (name, uris, description, custom_fields) are correctly parsed
  • Verify password extraction from secret custom fields works
  • Verify existing resource types are unaffected

- Add CustomField struct for shared custom field item representation
- Add SecretDataTypeV5CustomFields and ResourceMetadataTypeV5CustomFields types
- Add fallback JSON schema for v5-custom-fields
- Add switch case in GetResourceFromDataWithOptions to decrypt v5-custom-fields resources
- Extract password from first custom field of type "password" in secret data
- Downgrade go.mod to 1.23.0 for broader compatibility
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cedricherzog-passbolt
Copy link

Hi, thanks for taking the time to contribute!

We really appreciate it. We're currently working on a broader fix for this in #67, which should address this issue as part of a more comprehensive solution.

With that in mind, I'll be closing this PR for now, but please don't hesitate to get involved in #67 if you'd like to help shape the direction there.

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.

3 participants