Skip to content
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

feat(access-api): access-api version endpoint has publicKey property #317

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/access-api/src/bindings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Email } from './utils/email.js'
import { Spaces } from './models/spaces.js'
import { Validations } from './models/validations.js'
import { loadConfig } from './config.js'
import { Signer as EdSigner } from '@ucanto/principal/ed25519'

export {}

Expand Down Expand Up @@ -42,7 +43,7 @@ export interface Env {

export interface RouteContext {
log: Logging
signer: Signer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Signer didn't resolve to anything before in my tsc setup, so was treated as any

signer: EdSigner.Signer
config: ReturnType<typeof loadConfig>
url: URL
email: Email
Expand Down
2 changes: 1 addition & 1 deletion packages/access-api/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function createAnalyticsEngine() {
* @param {object} config
* @param {string} config.PRIVATE_KEY - multiformats private key of primary signing key
* @param {string} [config.DID] - public DID for the service (did:key:... derived from PRIVATE_KEY if not set)
* @returns {import('@ucanto/interface').Signer}
* @returns {Signer.Signer}
*/
export function configureSigner(config) {
const signer = Signer.parse(config.PRIVATE_KEY)
Expand Down
1 change: 1 addition & 0 deletions packages/access-api/src/routes/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export async function version(event, env, ctx) {
commit: env.config.COMMITHASH,
branch: env.config.BRANCH,
did: env.signer.did(),
publicKey: env.signer.verifier.toDIDKey(),
})
}