Documentation ¶
Index ¶
- Variables
- func ConvertArticleMetadata(in *ArticleMetadataInput) (*article.Metadata, error)
- func ConvertCredentialSchema(in ClaimCredentialSchemaInput) claimtypes.CredentialSchema
- func ConvertCredentialSubject(in *ClaimCredentialSubjectInput) (claimtypes.ContentCredentialSubject, error)
- func ConvertCredentialTypes(in []string) []claimtypes.CredentialType
- func ConvertInputProof(in *LinkedDataProofInput) (*linkeddata.Proof, error)
- func InputClaimToContentCredential(in *ClaimSaveRequestInput) (*claimtypes.ContentCredential, error)
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type ArticleMetadataContributorInput
- type ArticleMetadataImageInput
- type ArticleMetadataInput
- type ArticleMetadataResolver
- type ClaimCredentialSchemaInput
- type ClaimCredentialSubjectInput
- type ClaimGetRequestInput
- type ClaimGetResponse
- type ClaimInput
- type ClaimProofRequestInput
- type ClaimProofResponse
- type ClaimRegisteredProof
- type ClaimResolver
- type ClaimSaveRequestInput
- type ClaimSaveResponse
- type ComplexityRoot
- type Config
- type ContentClaimCredentialSubject
- type DidDocAuthenticationResolver
- type DidDocPublicKeyResolver
- type DidDocServiceResolver
- type DidDocumentResolver
- type DidGetRequestInput
- type DidGetResponse
- type DidSaveResponse
- type DirectiveRoot
- type EdgeResolver
- type FindEdgesInput
- type LinkedDataProofInput
- type MutationResolver
- type Proof
- type QueryResolver
- type Resolver
- func (r *Resolver) ArticleMetadata() ArticleMetadataResolver
- func (r *Resolver) Claim() ClaimResolver
- func (r *Resolver) DidDocAuthentication() DidDocAuthenticationResolver
- func (r *Resolver) DidDocPublicKey() DidDocPublicKeyResolver
- func (r *Resolver) DidDocService() DidDocServiceResolver
- func (r *Resolver) DidDocument() DidDocumentResolver
- func (r *Resolver) Edge() EdgeResolver
- func (r *Resolver) Mutation() MutationResolver
- func (r *Resolver) Query() QueryResolver
- func (r *Resolver) Version(ctx context.Context) (string, error)
- type ResolverRoot
- type RootOnBlockChainProof
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAccessDenied is a generic error for unauthorized access ErrAccessDenied = errors.New("access denied") // ResponseOK is a generic OK response string ResponseOK = "ok" // ResponseError is a generic error response string ResponseError = "error" // ResponseNotImplemented is a generic response string for non-implemented endpoints ResponseNotImplemented = "not implemented" )
Functions ¶
func ConvertArticleMetadata ¶
func ConvertArticleMetadata(in *ArticleMetadataInput) (*article.Metadata, error)
ConvertArticleMetadata converts incoming article metadata and converts it to core article metadata object
func ConvertCredentialSchema ¶
func ConvertCredentialSchema(in ClaimCredentialSchemaInput) claimtypes.CredentialSchema
ConvertCredentialSchema converts input cred schema to core credential schema
func ConvertCredentialSubject ¶
func ConvertCredentialSubject(in *ClaimCredentialSubjectInput) ( claimtypes.ContentCredentialSubject, error)
ConvertCredentialSubject converts subject input to core credential subject
func ConvertCredentialTypes ¶
func ConvertCredentialTypes(in []string) []claimtypes.CredentialType
ConvertCredentialTypes converts strings to credential types
func ConvertInputProof ¶
func ConvertInputProof(in *LinkedDataProofInput) (*linkeddata.Proof, error)
ConvertInputProof validates and converts linked data proof input to a core linked data proof.
func InputClaimToContentCredential ¶
func InputClaimToContentCredential(in *ClaimSaveRequestInput) (*claimtypes.ContentCredential, error)
InputClaimToContentCredential is convenience function to convert input claim to content credential
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type ArticleMetadataInput ¶
type ArticleMetadataInput struct { Title *string `json:"title"` RevisionContentHash *string `json:"revisionContentHash"` RevisionContentURL *string `json:"revisionContentURL"` CanonicalURL *string `json:"canonicalURL"` Slug *string `json:"slug"` Description *string `json:"description"` Contributors []*ArticleMetadataContributorInput `json:"contributors"` Images []*ArticleMetadataImageInput `json:"images"` Tags []*string `json:"tags"` PrimaryTag *string `json:"primaryTag"` RevisionDate *string `json:"revisionDate"` OriginalPublishDate *string `json:"originalPublishDate"` Opinion *bool `json:"opinion"` CivilSchemaVersion *string `json:"civilSchemaVersion"` }
type ArticleMetadataResolver ¶
type ClaimCredentialSubjectInput ¶
type ClaimCredentialSubjectInput struct { ID string `json:"id"` Metadata *ArticleMetadataInput `json:"metadata"` }
type ClaimGetRequestInput ¶
type ClaimGetRequestInput struct {
Did string `json:"did"`
}
type ClaimGetResponse ¶
type ClaimGetResponse struct {
Claims []*claimtypes.ContentCredential `json:"claims"`
}
ClaimGetResponse represents the GraphQL response for ClaimGet
func (*ClaimGetResponse) ClaimsRaw ¶
func (d *ClaimGetResponse) ClaimsRaw() []string
ClaimsRaw returns the raw JSON string for the list of claims
type ClaimInput ¶
type ClaimInput struct { Context []string `json:"context"` Type []string `json:"type"` CredentialSubject *ClaimCredentialSubjectInput `json:"credentialSubject"` Issuer string `json:"issuer"` Holder string `json:"holder"` CredentialSchema *ClaimCredentialSchemaInput `json:"credentialSchema"` IssuanceDate string `json:"issuanceDate"` Proof []*LinkedDataProofInput `json:"proof"` }
type ClaimProofRequestInput ¶
type ClaimProofRequestInput struct { Claim *ClaimInput `json:"claim"` ClaimJSON *string `json:"claimJson"` Did string `json:"did"` }
type ClaimProofResponse ¶
type ClaimProofResponse struct { Claim *claimtypes.ContentCredential `json:"claim"` ClaimRaw string `json:"claimRaw"` }
type ClaimRegisteredProof ¶
type ClaimRegisteredProof struct { Type string `json:"type"` Did string `json:"did"` ExistsInDIDMTProof string `json:"existsInDIDMTProof"` NotRevokedInDIDMTProof string `json:"notRevokedInDIDMTProof"` DidMTRootExistsProof string `json:"didMTRootExistsProof"` DidRootExistsVersion int `json:"didRootExistsVersion"` Root string `json:"root"` DidMTRoot string `json:"didMTRoot"` }
func (ClaimRegisteredProof) IsProof ¶
func (ClaimRegisteredProof) IsProof()
type ClaimResolver ¶
type ClaimResolver interface { Type(ctx context.Context, obj *claimtypes.ContentCredential) ([]string, error) CredentialSubject(ctx context.Context, obj *claimtypes.ContentCredential) (*ContentClaimCredentialSubject, error) IssuanceDate(ctx context.Context, obj *claimtypes.ContentCredential) (string, error) Proof(ctx context.Context, obj *claimtypes.ContentCredential) ([]Proof, error) }
type ClaimSaveRequestInput ¶
type ClaimSaveRequestInput struct { Claim *ClaimInput `json:"claim"` ClaimJSON *string `json:"claimJson"` }
type ClaimSaveResponse ¶
type ClaimSaveResponse struct {
Claim *claimtypes.ContentCredential `json:"claim"`
}
ClaimSaveResponse represents the GraphQL response for ClaimSave
func (*ClaimSaveResponse) ClaimRaw ¶
func (d *ClaimSaveResponse) ClaimRaw() *string
ClaimRaw returns the raw JSON string of the claim
type ComplexityRoot ¶
type ComplexityRoot struct { ArticleMetadata struct { CanonicalURL func(childComplexity int) int CivilSchemaVersion func(childComplexity int) int Contributors func(childComplexity int) int Description func(childComplexity int) int Images func(childComplexity int) int Opinion func(childComplexity int) int OriginalPublishDate func(childComplexity int) int PrimaryTag func(childComplexity int) int RevisionContentHash func(childComplexity int) int RevisionContentURL func(childComplexity int) int RevisionDate func(childComplexity int) int Slug func(childComplexity int) int Tags func(childComplexity int) int Title func(childComplexity int) int } ArticleMetadataContributor struct { Name func(childComplexity int) int Role func(childComplexity int) int } ArticleMetadataImage struct { H func(childComplexity int) int Hash func(childComplexity int) int URL func(childComplexity int) int W func(childComplexity int) int } Claim struct { Context func(childComplexity int) int CredentialSchema func(childComplexity int) int CredentialSubject func(childComplexity int) int Holder func(childComplexity int) int IssuanceDate func(childComplexity int) int Issuer func(childComplexity int) int Proof func(childComplexity int) int Type func(childComplexity int) int } ClaimCredentialSchema struct { ID func(childComplexity int) int Type func(childComplexity int) int } ClaimGetResponse struct { Claims func(childComplexity int) int ClaimsRaw func(childComplexity int) int } ClaimProofResponse struct { Claim func(childComplexity int) int ClaimRaw func(childComplexity int) int } ClaimRegisteredProof struct { Did func(childComplexity int) int DidMTRoot func(childComplexity int) int DidMTRootExistsProof func(childComplexity int) int DidRootExistsVersion func(childComplexity int) int ExistsInDIDMTProof func(childComplexity int) int NotRevokedInDIDMTProof func(childComplexity int) int Root func(childComplexity int) int Type func(childComplexity int) int } ClaimSaveResponse struct { Claim func(childComplexity int) int ClaimRaw func(childComplexity int) int } ContentClaimCredentialSubject struct { ID func(childComplexity int) int Metadata func(childComplexity int) int } DidDocAuthentication struct { IDOnly func(childComplexity int) int PublicKey func(childComplexity int) int } DidDocPublicKey struct { Controller func(childComplexity int) int EthereumAddress func(childComplexity int) int ID func(childComplexity int) int PublicKeyBase58 func(childComplexity int) int PublicKeyBase64 func(childComplexity int) int PublicKeyHex func(childComplexity int) int PublicKeyJwk func(childComplexity int) int PublicKeyMultibase func(childComplexity int) int PublicKeyPem func(childComplexity int) int Type func(childComplexity int) int } DidDocService struct { Description func(childComplexity int) int ID func(childComplexity int) int PublicKey func(childComplexity int) int ServiceEndpoint func(childComplexity int) int Type func(childComplexity int) int } DidDocument struct { Authentications func(childComplexity int) int Context func(childComplexity int) int Controller func(childComplexity int) int Created func(childComplexity int) int ID func(childComplexity int) int Proof func(childComplexity int) int PublicKeys func(childComplexity int) int Services func(childComplexity int) int Updated func(childComplexity int) int } DidGetResponse struct { Doc func(childComplexity int) int DocRaw func(childComplexity int) int } DidSaveResponse struct { Doc func(childComplexity int) int DocRaw func(childComplexity int) int } Edge struct { Data func(childComplexity int) int From func(childComplexity int) int Hash func(childComplexity int) int JWT func(childComplexity int) int Proof func(childComplexity int) int Time func(childComplexity int) int To func(childComplexity int) int Type func(childComplexity int) int } LinkedDataProof struct { Created func(childComplexity int) int Creator func(childComplexity int) int Domain func(childComplexity int) int Nonce func(childComplexity int) int ProofValue func(childComplexity int) int Type func(childComplexity int) int } Mutation struct { AddEdge func(childComplexity int, edgeJwt *string) int ClaimSave func(childComplexity int, in *ClaimSaveRequestInput) int Version func(childComplexity int) int } Query struct { ClaimGet func(childComplexity int, in *ClaimGetRequestInput) int ClaimProof func(childComplexity int, in *ClaimProofRequestInput) int DidGet func(childComplexity int, in *DidGetRequestInput) int FindEdges func(childComplexity int, in *FindEdgesInput) int Version func(childComplexity int) int } RootOnBlockChainProof struct { BlockNumber func(childComplexity int) int CommitterAddress func(childComplexity int) int ContractAddress func(childComplexity int) int Root func(childComplexity int) int TxHash func(childComplexity int) int Type func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DidDocAuthenticationResolver ¶
type DidDocAuthenticationResolver interface {
PublicKey(ctx context.Context, obj *did.DocAuthenicationWrapper) (*did.DocPublicKey, error)
}
type DidDocPublicKeyResolver ¶
type DidDocServiceResolver ¶
type DidDocumentResolver ¶
type DidGetRequestInput ¶
type DidGetRequestInput struct {
Did *string `json:"did"`
}
type DidGetResponse ¶
DidGetResponse represents the GraphQL response for DidGet
func (*DidGetResponse) DocRaw ¶
func (d *DidGetResponse) DocRaw() *string
DocRaw returns the raw JSON string for the docRaw field
type DidSaveResponse ¶
DidSaveResponse represents the GraphQL response for DidSave
func (*DidSaveResponse) DocRaw ¶
func (d *DidSaveResponse) DocRaw() *string
DocRaw returns the raw JSON string for the docRaw field
type DirectiveRoot ¶
type DirectiveRoot struct { }
type EdgeResolver ¶
type EdgeResolver interface { From(ctx context.Context, obj *claimsstore.JWTClaimPostgres) (string, error) To(ctx context.Context, obj *claimsstore.JWTClaimPostgres) (*string, error) Time(ctx context.Context, obj *claimsstore.JWTClaimPostgres) (string, error) Proof(ctx context.Context, obj *claimsstore.JWTClaimPostgres) ([]Proof, error) }
type FindEdgesInput ¶
type LinkedDataProofInput ¶
type MutationResolver ¶
type MutationResolver interface { Version(ctx context.Context) (string, error) ClaimSave(ctx context.Context, in *ClaimSaveRequestInput) (*ClaimSaveResponse, error) AddEdge(ctx context.Context, edgeJwt *string) (*claimsstore.JWTClaimPostgres, error) }
type QueryResolver ¶
type QueryResolver interface { Version(ctx context.Context) (string, error) DidGet(ctx context.Context, in *DidGetRequestInput) (*DidGetResponse, error) ClaimGet(ctx context.Context, in *ClaimGetRequestInput) (*ClaimGetResponse, error) ClaimProof(ctx context.Context, in *ClaimProofRequestInput) (*ClaimProofResponse, error) FindEdges(ctx context.Context, in *FindEdgesInput) ([]*claimsstore.JWTClaimPostgres, error) }
type Resolver ¶
type Resolver struct { DidService *did.Service ClaimService *claims.Service JWTService *claims.JWTService }
Resolver is the main GraphQL resolver
func (*Resolver) ArticleMetadata ¶
func (r *Resolver) ArticleMetadata() ArticleMetadataResolver
ArticleMetadata returns the resolver for article metadata
func (*Resolver) Claim ¶
func (r *Resolver) Claim() ClaimResolver
Claim returns the resolver for claims
func (*Resolver) DidDocAuthentication ¶
func (r *Resolver) DidDocAuthentication() DidDocAuthenticationResolver
DidDocAuthentication is the resolver for DID Authentications
func (*Resolver) DidDocPublicKey ¶
func (r *Resolver) DidDocPublicKey() DidDocPublicKeyResolver
DidDocPublicKey is the resolver for the DID public key
func (*Resolver) DidDocService ¶
func (r *Resolver) DidDocService() DidDocServiceResolver
DidDocService is the resolver for the DID service
func (*Resolver) DidDocument ¶
func (r *Resolver) DidDocument() DidDocumentResolver
DidDocument is the resolver for the DID document
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
Mutation is the resolver for the Mutation type
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query is the resolver for the Query type
type ResolverRoot ¶
type ResolverRoot interface { ArticleMetadata() ArticleMetadataResolver Claim() ClaimResolver DidDocAuthentication() DidDocAuthenticationResolver DidDocPublicKey() DidDocPublicKeyResolver DidDocService() DidDocServiceResolver DidDocument() DidDocumentResolver Edge() EdgeResolver Mutation() MutationResolver Query() QueryResolver }
type RootOnBlockChainProof ¶
type RootOnBlockChainProof struct { Type string `json:"type"` BlockNumber string `json:"blockNumber"` Root string `json:"root"` ContractAddress string `json:"contractAddress"` CommitterAddress string `json:"committerAddress"` TxHash string `json:"txHash"` }
func (RootOnBlockChainProof) IsProof ¶
func (RootOnBlockChainProof) IsProof()