-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add Attestify (Issue Certificate action) #21209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
novadyne-hq
wants to merge
7
commits into
PipedreamHQ:master
Choose a base branch
from
novadyne-hq:add-attestify-components
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+182
−0
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1214106
Add components/attestify/attestify.app.mjs
novadyne-hq 84906c1
Add components/attestify/package.json
novadyne-hq ccf42c8
Add components/attestify/README.md
novadyne-hq 2efa9cc
Add components/attestify/actions/issue-certificate/issue-certificate.mjs
novadyne-hq 23f5c38
Add components/attestify/actions/issue-certificate/README.md
novadyne-hq fc0dada
Address review: components/attestify/attestify.app.mjs
novadyne-hq b09b4be
Address review: components/attestify/actions/issue-certificate/issue-…
novadyne-hq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| # Attestify | ||
|
|
||
| Attestify issues tamper-evident, cryptographically-verifiable certificates. Each certificate gets a | ||
| permanent public verify page anyone can check — Ed25519-signed, so it can't be forged after issuance. | ||
| Free, no signup required. | ||
|
|
||
| Learn more: https://attestify.novadyne.ai |
This file contains hidden or 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,18 @@ | ||
| # Issue Certificate | ||
|
|
||
| Issue a tamper-evident, cryptographically-verifiable certificate with Attestify. Each certificate | ||
| gets a permanent public verify page anyone can check — Ed25519-signed, so it can't be forged after | ||
| issuance. Free, no signup. | ||
|
|
||
| **Props** | ||
| - **Organization / Issuer** (required) — shown on the certificate and the public verify page. | ||
| - **Course / Credential** (required) — what the certificate is for. | ||
| - **Recipient Name** (required) — name on the certificate. | ||
| - **Recipient Email** (optional) — echoed back so you can join it to the verify URL for a mail-merge | ||
| or LMS step. Never stored in the signed record and never shown on the public verify page. | ||
| - **Completion Date** (optional, `YYYY-MM-DD`) — defaults to today. | ||
|
|
||
| **Returns** the issued certificate: `cert_id`, `verify_url` (the permanent public page), | ||
| `signed_record_url` (the Ed25519-signed JSON), `cert_image_url`, plus the echoed fields. | ||
|
|
||
| Docs: https://attestify.novadyne.ai |
67 changes: 67 additions & 0 deletions
67
components/attestify/actions/issue-certificate/issue-certificate.mjs
This file contains hidden or 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,67 @@ | ||
| import app from "../../attestify.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "attestify-issue-certificate", | ||
| name: "Issue Certificate", | ||
| description: | ||
| "Issue a tamper-evident, cryptographically-verifiable certificate. Each certificate gets a permanent public verify page anyone can check — Ed25519-signed, so it can't be forged after issuance. Free, no signup. [See the docs](https://attestify.novadyne.ai).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| app, | ||
| issuer: { propDefinition: [app, "issuer"] }, | ||
| course: { propDefinition: [app, "course"] }, | ||
| recipientName: { propDefinition: [app, "recipientName"] }, | ||
| recipientEmail: { propDefinition: [app, "recipientEmail"] }, | ||
| completionDate: { propDefinition: [app, "completionDate"] }, | ||
| }, | ||
| async run({ $ }) { | ||
| if (this.completionDate && !/^\d{4}-\d{2}-\d{2}$/.test(this.completionDate)) { | ||
| throw new Error( | ||
| `Completion Date must be in YYYY-MM-DD format (got "${this.completionDate}")`, | ||
| ); | ||
| } | ||
|
|
||
| const recipient = { name: this.recipientName }; | ||
| if (this.recipientEmail) recipient.email = this.recipientEmail; | ||
|
|
||
| const body = { | ||
| issuer: this.issuer, | ||
| course: this.course, | ||
| recipients: [recipient], | ||
| }; | ||
| if (this.completionDate) body.date = this.completionDate; | ||
|
|
||
| const resp = await this.app.issueCertificate($, body); | ||
|
|
||
| if (!resp || resp.ok !== true) { | ||
| const err = resp?.error ?? "unknown"; | ||
| const detail = resp?.detail ? ` — ${resp.detail}` : ""; | ||
| throw new Error(`Attestify error: ${err}${detail}`); | ||
| } | ||
|
|
||
| const cert = resp.certs && resp.certs[0]; | ||
| if (!cert) { | ||
| throw new Error( | ||
| "Attestify returned no certificate (the recipient may have been empty, or the request was treated as an automated crawler).", | ||
| ); | ||
| } | ||
|
|
||
| $.export( | ||
| "$summary", | ||
| `Issued certificate ${cert.cert_id} for ${cert.recipient_name} — verify at ${cert.verify_url}`, | ||
| ); | ||
|
|
||
| return { | ||
| cert_id: cert.cert_id, | ||
| recipient_name: cert.recipient_name, | ||
| recipient_email: cert.recipient_email ?? (this.recipientEmail || undefined), | ||
| course: cert.course, | ||
| issuer: cert.issuer, | ||
| completion_date: this.completionDate || undefined, | ||
| verify_url: cert.verify_url, | ||
| cert_image_url: cert.cert_url, | ||
| signed_record_url: cert.json_url, | ||
| }; | ||
| }, | ||
| }; | ||
This file contains hidden or 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 { axios } from "@pipedream/platform"; | ||
|
|
||
| // Attestify needs no credentials (free, no signup), so this app declares no auth. | ||
| // It exists as the branded namespace + shared HTTP method/prop definitions for the actions. | ||
| export default { | ||
| type: "app", | ||
| app: "attestify", | ||
| propDefinitions: { | ||
| issuer: { | ||
| type: "string", | ||
| label: "Organization / Issuer", | ||
| description: | ||
| "The organization issuing the certificate (shown on the certificate and the public verify page). Example: `Acme Real Estate Academy`.", | ||
| }, | ||
| course: { | ||
| type: "string", | ||
| label: "Course / Credential", | ||
| description: | ||
| "The course or credential being certified. Example: `4-Hour Continuing Education — Ethics`.", | ||
| }, | ||
| recipientName: { | ||
| type: "string", | ||
| label: "Recipient Name", | ||
| description: "Name of the certificate recipient.", | ||
| }, | ||
| recipientEmail: { | ||
| type: "string", | ||
| label: "Recipient Email", | ||
| description: | ||
| "Optional. Echoed back so you can join it to the verify URL for your mail-merge or LMS. It is **never** stored in the signed record and **never** shown on the public verify page — recipient PII stays on your side.", | ||
| optional: true, | ||
| }, | ||
| completionDate: { | ||
| type: "string", | ||
| label: "Completion Date", | ||
| description: | ||
| "Optional. The date the credential was earned, shown on the certificate (format `YYYY-MM-DD`). Leave empty to stamp today.", | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| optional: true, | ||
| }, | ||
| }, | ||
| methods: { | ||
| _baseUrl() { | ||
| return "https://attestify.novadyne.ai"; | ||
| }, | ||
| async _request($, { path, headers, ...opts } = {}) { | ||
| return axios($, { | ||
| ...opts, | ||
| url: `${this._baseUrl()}${path}`, | ||
| headers: { | ||
| ...headers, | ||
| // identify Pipedream-sourced issuances in telemetry (= the demand signal) | ||
| "User-Agent": "pipedream-attestify/0.0.1", | ||
| }, | ||
| }); | ||
| }, | ||
| async issueCertificate($, data) { | ||
| return this._request($, { | ||
| method: "POST", | ||
| path: "/cert/issue", | ||
| data, | ||
| }); | ||
| }, | ||
| }, | ||
| }; | ||
This file contains hidden or 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,21 @@ | ||
| { | ||
| "name": "@pipedream/attestify", | ||
| "version": "0.0.1", | ||
| "description": "Pipedream Attestify Components — issue tamper-evident, cryptographically-verifiable certificates with a permanent public verify page.", | ||
| "main": "attestify.app.mjs", | ||
| "type": "module", | ||
| "keywords": [ | ||
| "pipedream", | ||
| "attestify", | ||
| "certificates", | ||
| "verifiable-credentials" | ||
| ], | ||
| "homepage": "https://pipedream.com/apps/attestify", | ||
| "author": "Novadyne", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "^3.0.3" | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.