Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

SIP 2 - Create Credential Manifests CRUD #91

Merged
merged 5 commits into from
Sep 9, 2022
Merged

SIP 2 - Create Credential Manifests CRUD #91

merged 5 commits into from
Sep 9, 2022

Conversation

nitro-neal
Copy link
Contributor

This is the implementation of the Credential Manifest CRUD functionality according to SIP 2
https://github.com/TBD54566975/ssi-service/tree/main/sip/sips/sip_2

image

Postman Datad
PUT Manifest

Input:

{
  "@context": "",
  "issuer" : "did:example:123",
  "outputDescriptors": [
            {
                "id": "id1z1",
                "schema": "https://test.com/schema",
                "name": "good ID",
                "description": "it's all good"
            },
            {
                "id": "id2z",
                "schema": "https://test.com/schema",
                "name": "good ID",
                "description": "it's all good"
            }
        ],
   "presentationDefinition": {
    "id": "test",
    "input_descriptors": [
      {
        "id": "test input descriptor",
        "constraints" : 
            {
                "fields" : [ 
                    {
                    "path" : [
                        "path1"
                    ]
                    }
                ]
            }
        

      }
    ]
  }
}

Output

{
    "manifest": {
        "id": "a2170fed-81cd-42db-ad79-3d65ea720878",
        "issuer": {
            "id": "did:example:123",
            "name": "did:example:123"
        },
        "output_descriptors": [
            {
                "id": "id1z1",
                "schema": "https://test.com/schema",
                "name": "good ID",
                "description": "it's all good"
            },
            {
                "id": "id2z",
                "schema": "https://test.com/schema",
                "name": "good ID",
                "description": "it's all good"
            }
        ],
        "format": {
            "jwt": {
                "alg": [
                    "EdDSA"
                ]
            }
        },
        "presentation_definition": {
            "id": "test",
            "input_descriptors": [
                {
                    "id": "test input descriptor",
                    "constraints": {
                        "fields": [
                            {
                                "path": [
                                    "path1"
                                ]
                            }
                        ]
                    }
                }
            ]
        }
    }
}

@@ -24,6 +24,8 @@ require (

require go.etcd.io/bbolt v1.3.6

require github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 // indirect
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see where I added this or used this? When I try to remove it brings it back when I mage build

@codecov-commenter
Copy link

codecov-commenter commented Sep 8, 2022

Codecov Report

Merging #91 (4df6c79) into main (ee6df8d) will decrease coverage by 0.68%.
The diff coverage is 20.83%.

@@            Coverage Diff             @@
##             main      #91      +/-   ##
==========================================
- Coverage   26.63%   25.94%   -0.69%     
==========================================
  Files          13       14       +1     
  Lines         751      844      +93     
==========================================
+ Hits          200      219      +19     
- Misses        521      594      +73     
- Partials       30       31       +1     
Impacted Files Coverage Δ
config/config.go 12.50% <ø> (ø)
pkg/server/router/schema.go 15.68% <0.00%> (ø)
pkg/server/router/manifest.go 10.12% <10.12%> (ø)
pkg/server/server.go 68.86% <80.00%> (+1.47%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@nitro-neal nitro-neal changed the title OSE-25-sip-2-create-credential-manifest-crud-in-ssi-service SIP 2 - Create Credential Manifests CRUD Sep 8, 2022
Copy link
Member

@decentralgabe decentralgabe left a comment

Choose a reason for hiding this comment

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

one more thing - the config.toml files should be updated to have a new manifest entry

pkg/server/router/manifest.go Outdated Show resolved Hide resolved
pkg/server/router/manifest.go Outdated Show resolved Hide resolved
pkg/server/router/manifest.go Show resolved Hide resolved
// @Router /v1/manifests [get]
func (cr ManifestRouter) GetManifests(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
gotManifests, err := cr.service.GetManifests()

Copy link
Member

Choose a reason for hiding this comment

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

where do you handle the query parameters?

pkg/server/router/manifest.go Outdated Show resolved Hide resolved
pkg/service/manifest/storage/bolt.go Outdated Show resolved Hide resolved
pkg/service/manifest/storage/bolt.go Outdated Show resolved Hide resolved
pkg/service/manifest/model.go Outdated Show resolved Hide resolved
Copy link
Member

@decentralgabe decentralgabe left a comment

Choose a reason for hiding this comment

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

Past the change to config.toml, lgtm!

@decentralgabe decentralgabe added this to the Milestone 2 milestone Sep 9, 2022
@nitro-neal nitro-neal merged commit 62b812c into main Sep 9, 2022
@nitro-neal nitro-neal deleted the cred-manifest branch September 9, 2022 23:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants