Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fuzzy query all the content in the value of credentialSubject #652

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jduan1993
Copy link

  • Used to fuzzy query all the content in the value of credentialSubject, case insensitive.
  • It can be applied to scenarios where did owner needs to be quickly located. The owner information is contained in the field of credentialSubject, and the fuzzy query can be used to locate the credential to realize the corresponding operation, such as revocation.
  • Example: For example, if the account of a natural person needs to be restricted or closed, we can use this feature.

@jduan1993 jduan1993 requested a review from a team as a code owner April 10, 2024 02:13
Copy link
Contributor

@x1m3 x1m3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, We cannot merge this PR because it is editing a automatic generated code and it also lacks some testing to better understand the purposes and the risks.

@@ -802,6 +802,9 @@ func getCredentialsFilter(ctx context.Context, req GetCredentialsRequestObject)
if req.Params.Query != nil {
filter.FTSQuery = *req.Params.Query
}
if req.Params.VCFuzzyQuery != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file cannot be editable. It is automatically generated by the when running make api-ui. So it will be overwritten.

@@ -817,6 +817,15 @@ func buildGetAllQueryAndFilters(issuerID w3c.DID, filter *ports.ClaimsFilter) (q
filters = append(filters, filter.QueryField, filter.QueryFieldValue)
query = fmt.Sprintf("%s and data -> 'credentialSubject' ->>$%d = $%d ", query, len(filters)-1, len(filters))
}
/**
* Used to fuzzy query all the content in the value of credentialSubject, case-insensitive
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should need a test for this,

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.

None yet

2 participants