-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Orie Steele
committed
Mar 19, 2022
1 parent
a88ef5c
commit fb3f9da
Showing
7 changed files
with
190 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Publish Issuer | ||
|
||
on: [push] | ||
|
||
jobs: | ||
publish_issuer: | ||
name: Publish Issuer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Create Issuer | ||
id: create_issuer | ||
uses: transmute-industries/[email protected] | ||
with: | ||
resource: "did" | ||
action: "generate" | ||
username: "transmute-industries" | ||
repository: "public-credential-registry-template" | ||
mnemonic: "${{ secrets.MNEMONIC }}" | ||
hd-path: "m/44'/0'/0'/0/0" | ||
key-type: "ed25519" | ||
# This path has to match what will be expected when resolving a did web. | ||
file-output: "./issuers/z6MktiSzqF9kqwdU8VkdBKx56EYzXfpgnNPUAGznpicNiWfn/did.json" | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
branch: main | ||
commit_message: Issuer updated |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Public Container Registry | ||
|
||
on: [push] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build_image: | ||
name: Build Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Create Issuer | ||
id: create_issuer | ||
uses: transmute-industries/[email protected] | ||
with: | ||
resource: "did" | ||
action: "generate" | ||
username: "transmute-industries" | ||
repository: "public-credential-registry-template" | ||
mnemonic: "${{ secrets.MNEMONIC }}" | ||
hd-path: "m/44'/0'/0'/0/0" | ||
key-type: "ed25519" | ||
# This path has to match what will be expected when resolving a did web. | ||
file-output: "./issuers/z6MktiSzqF9kqwdU8VkdBKx56EYzXfpgnNPUAGznpicNiWfn/did.json" | ||
|
||
- name: Export metadata to be Signed | ||
run: echo ${{ steps.meta.outputs.json }} > ./templates/opencontainers-meta.json | ||
|
||
# - name: Sign Revision | ||
|
||
- name: Create a Verifiable Credential | ||
id: create_registry_credential | ||
uses: transmute-industries/[email protected] | ||
with: | ||
resource: "credential" | ||
action: "create" | ||
username: "transmute-industries" | ||
repository: "public-credential-registry-template" | ||
mnemonic: "${{ secrets.MNEMONIC }}" | ||
hd-path: "m/44'/0'/0'/0/0" | ||
key-type: "ed25519" | ||
|
||
file-input: "./templates/example.json" | ||
file-output: "./credentials" | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: |- | ||
${{ steps.meta.outputs.labels }} | ||
org.opencontainers.image.jwt=foo-bar-baz |
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
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,85 @@ | ||
# Public Credential Website | ||
|
||
A public credential registry is useful for managing lists of credentials where the privacy of the subject is less imporant than the discoverability of the subject. | ||
|
||
Examples include: | ||
|
||
- [DNS Root Servers](https://www.iana.org/domains/root/servers) | ||
- [Medical Board Certification](https://www.tmb.state.tx.us/page/resources-advertisement-board-certification) | ||
|
||
### Getting Started | ||
|
||
You will need to setup a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets) for your `mnemonic`. | ||
|
||
You can use [api.did.actor](https://api.did.actor/) or any [BIP 39 mnemonic](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki). | ||
|
||
```yml | ||
mnemonic: "${{ secrets.MNEMONIC }}" | ||
``` | ||
Next you will need to create a credential issuer that can be hosted in github pages. | ||
```yml | ||
- name: Create Issuer | ||
id: create_issuer | ||
uses: transmute-industries/[email protected] | ||
with: | ||
resource: "did" | ||
action: "generate" | ||
username: "transmute-industries" | ||
repository: "public-credential-registry-template" | ||
mnemonic: "${{ secrets.MNEMONIC }}" | ||
hd-path: "m/44'/0'/0'/0/0" | ||
key-type: "ed25519" | ||
# This path has to match what will be expected when resolving a did web. | ||
file-output: "./issuers/z6MktiSzqF9kqwdU8VkdBKx56EYzXfpgnNPUAGznpicNiWfn/did.json" | ||
``` | ||
This step will create a "did:web" DID Document for the DID: | ||
- did:web:transmute-industries.github.io:public-credential-registry-template:issuers:z6MktiSzqF9kqwdU8VkdBKx56EYzXfpgnNPUAGznpicNiWfn | ||
This is the identifer that holds the verification keys for claims made in this repository. | ||
Next you will need to create a Verifiable Credential: | ||
```yml | ||
- name: Create a Verifiable Credential | ||
id: create_registry_credential | ||
uses: transmute-industries/[email protected] | ||
with: | ||
resource: "credential" | ||
action: "create" | ||
username: "transmute-industries" | ||
repository: "public-credential-registry-template" | ||
mnemonic: "${{ secrets.MNEMONIC }}" | ||
hd-path: "m/44'/0'/0'/0/0" | ||
key-type: "ed25519" | ||
|
||
file-input: "./templates/example.json" | ||
file-output: "./credentials" | ||
``` | ||
This step will add a proof to the json example, move it to the credentials directory, and refresh the credential index. | ||
After this step, you will need to publish the registry updates with github pages. | ||
```yml | ||
- name: Deploy Registry | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
enable_jekyll: true | ||
publish_dir: . | ||
exclude_assets: ".github" | ||
``` | ||
After this workflow succeeds you should be able to see the issuers and credentials for the registry by browsung the published website. | ||
## Issuers | ||
- [issuer](https://transmute-industries.github.io/public-credential-registry-template/issuers/z6MktiSzqF9kqwdU8VkdBKx56EYzXfpgnNPUAGznpicNiWfn/did.json) | ||
## Credentials | ||
- [credentials](https://transmute-industries.github.io/public-credential-registry-template/credentials/) |
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,6 +1,6 @@ | ||
#!/bin/sh | ||
|
||
echo ''; | ||
echo '✨ generating mock implementation data.' | ||
echo '✨ your fancy docker container says hello as ' | ||
|
||
whoami |