-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Stabilized enabling OIDC with full happy flow and credential ver…
…ification
- Loading branch information
Showing
28 changed files
with
383 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
<http://localhost:3000/> a <http://www.w3.org/ns/pim/space#Storage>. | ||
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"@context": [ | ||
"https://www.w3.org/2018/credentials/v1", | ||
"https://w3id.org/security/data-integrity/v2" | ||
], | ||
"id": "urn:gov.flanders.be:credentials:2f195dc3-afad-4625-8d54-5142d57df604", | ||
"type": [ | ||
"VerifiableCredential" | ||
], | ||
"issuer": "http://localhost:4444/id#me", | ||
"issuanceDate": "2024-05-14T14:41:43Z", | ||
"credentialSubject": { | ||
"@id": "http://localhost:3000/ruben/profile/card", | ||
"http://www.w3.org/2006/vcard/ns#bday": { | ||
"@value": "1995-04-09T00:00:00.000Z", | ||
"@type": "http://www.w3.org/2001/XMLSchema#dateTime" | ||
} | ||
}, | ||
"proof": { | ||
"type": "DataIntegrityProof", | ||
"created": "2024-05-14T14:41:43Z", | ||
"verificationMethod": "http://localhost:4444/key", | ||
"cryptosuite": "eddsa-2022", | ||
"proofPurpose": "assertionMethod", | ||
"proofValue": "z4SYPZHamJ9Wzwnn9qP3WYPxtG7aSW6n3b6CucTDuSnm1z4fGan4quLxaBhaVpkXatoiSTWnFxaNwCsfWsMowhyDJ" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<urn:ucp:policy:418921dc-0d94-4ea7-9c8e-0dd6458ea440> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/odrl/2/Agreement> . | ||
<urn:ucp:policy:418921dc-0d94-4ea7-9c8e-0dd6458ea440> <http://www.w3.org/ns/odrl/2/permission> <urn:ucp:rule:0006d599-d841-448f-a062-7fbb4b60adb2> . | ||
<urn:ucp:rule:0006d599-d841-448f-a062-7fbb4b60adb2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/odrl/2/Permission> . | ||
<urn:ucp:rule:0006d599-d841-448f-a062-7fbb4b60adb2> <http://www.w3.org/ns/odrl/2/action> <http://www.w3.org/ns/odrl/2/read>, <http://www.w3.org/ns/odrl/2/write> . | ||
<urn:ucp:rule:0006d599-d841-448f-a062-7fbb4b60adb2> <http://www.w3.org/ns/odrl/2/target> <http://localhost:3000/ruben/**/*> . | ||
<urn:ucp:rule:0006d599-d841-448f-a062-7fbb4b60adb2> <http://www.w3.org/ns/odrl/2/assignee> <http://localhost:3000/ruben/profile/card#me> . | ||
<urn:ucp:policy:418921dc-0d94-4ea7-9c8e-0dd6458ea440> <http://purl.org/dc/elements/1.1/description> "Owner can read all resources on their data space" . |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
demo/sites/authorizationsite/src/components/CredentialsPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { useEffect, useState } from "react"; | ||
import { readCredentialsDirectory } from "../util/CredentialsManagement"; | ||
import { VerifiableCredential } from "../util/Types"; | ||
import { Session } from "@inrupt/solid-client-authn-browser"; | ||
|
||
export default function CredentialsPage({ | ||
session | ||
}: { | ||
session: Session | ||
}) { | ||
|
||
const [credentialsList, setCredentialsList] = useState<VerifiableCredential[]>([]) | ||
const [selectedCredential, setSelectedCredential] = useState<null|VerifiableCredential>(null) | ||
|
||
useEffect(() => { | ||
async function getCredentials() { | ||
let credentials: VerifiableCredential[] = [] | ||
try { | ||
credentials = await readCredentialsDirectory(session.fetch); | ||
} catch (_ignored) {} | ||
|
||
setCredentialsList(credentials) | ||
} | ||
getCredentials() | ||
}, []) | ||
|
||
// async function addPolicyFromText(policyText: string) { | ||
// console.log('Adding the following policy:') | ||
// console.log(policyText) | ||
// await doPolicyFlowFromString(policyText) | ||
// const policyObject = await readPolicy(policyText) | ||
// if(policyObject) setPolicyList(policyList.concat(policyObject)) | ||
// } | ||
|
||
function renderCredential(entity: VerifiableCredential) { | ||
return ( | ||
<div key={entity.id} className={ | ||
`policyentry ${entity.id === selectedCredential?.id ? 'selectedentry' : ''}` | ||
} onClick={() => setSelectedCredential(entity)}> | ||
<p>id: {entity.id}</p> | ||
<p>{entity.description}</p> | ||
</div> | ||
) | ||
} | ||
|
||
const selectedCredentialContents = selectedCredential | ||
? JSON.stringify(credentialsList.filter(c => c.id === selectedCredential.id)[0], null, 2) || '' | ||
: '' | ||
|
||
return ( | ||
<div id="credentials-page" className="page-view"> | ||
<div className="columncontainer flex-40"> | ||
<div id="credentials-list" > | ||
{ | ||
credentialsList.map(renderCredential) | ||
} | ||
</div> | ||
</div> | ||
<div id="PolicyDisplayScreen" className="flex-60"> | ||
<textarea id="policyview" value={selectedCredentialContents} readOnly/> | ||
</div> | ||
</div> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.