Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Orie Steele committed Mar 19, 2022
1 parent a88ef5c commit fb3f9da
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 68 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/create-issuer.yml
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
41 changes: 0 additions & 41 deletions .github/workflows/docker.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/docker.yml.skip
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
30 changes: 4 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,7 @@

[![Public Credential Registry](https://github.com/transmute-industries/public-credential-registry-template/actions/workflows/ci.yml/badge.svg)](https://github.com/transmute-industries/public-credential-registry-template/actions/workflows/ci.yml)

A zero code public credentials registry, powered by github actions, workflows and pages.

## 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/)

### About Template

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)
A zero code public credential registries, powered by github actions, workflows and pages.

The purpose of this repository is to provide a template for managing public credential registries using:

Expand All @@ -30,15 +13,10 @@ The purpose of this repository is to provide a template for managing public cred
- Decentralized Identifiers
- Verifiable Credentials

### 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).
### Examples

```yml
mnemonic: "${{ secrets.MNEMONIC }}"
```
- [Verifiable Credential Website](./docs/public-credential-website.md)
- [Signed Container Registry](./docs/public-container-registry.md)

#### Standards

Expand Down
Empty file.
85 changes: 85 additions & 0 deletions docs/public-credential-website.md
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/)
2 changes: 1 addition & 1 deletion sayHello.sh
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

0 comments on commit fb3f9da

Please sign in to comment.