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

Not able to build @openpassport/sdk using deno #190

Open
0xisk opened this issue Sep 6, 2024 · 2 comments
Open

Not able to build @openpassport/sdk using deno #190

0xisk opened this issue Sep 6, 2024 · 2 comments

Comments

@0xisk
Copy link

0xisk commented Sep 6, 2024

Hey!
I was trying to build a wrapper for @openpassport/sdk using Deno to be able to make it work in a rust project.
But I got this issue:

deno run --unstable --allow-read=node_modules --allow-net openPassportVerifier.ts                     ✔  18.16.1  

⚠️  The `--unstable` flag is deprecated and will be removed in Deno 2.0. Use granular `--unstable-*` flags instead.
Learn more at: https://docs.deno.com/runtime/manual/tools/unstable_flags
error: Error in @openpassport/sdk@0.1.7 parsing version requirement for dependency: node-forge@git+https://github.com/remicolin/forge.git

Invalid npm version requirement. Unexpected character.
  git+https://github.com/remicolin/forge.git
  ~
    at file:///home/isk/projects/pse/hackathon_2024/snark-verifier-server-rs/deno/src/openPassportVerifier.ts:1:96
// openPassportVerifier.ts
import { OpenPassport1StepInputs, OpenPassportVerifierReport, OpenPassport1StepVerifier } from 'npm:@openpassport/sdk@^0.1.7';

let verifier: OpenPassport1StepVerifier | null = null;

export function initializeVerifier(options: {
    scope: string;
    attestationId?: string;
    requirements?: string[][];
    rpcUrl?: string;
    dev_mode?: boolean;
}): void {
    verifier = new OpenPassport1StepVerifier(options);
}

export async function verifyPassport(openPassport1StepInputs: OpenPassport1StepInputs): Promise<OpenPassportVerifierReport> {
    if (!verifier) {
        throw new Error("Verifier has not been initialized. Please call initializeVerifier first.");
    }
    return await verifier.verify(openPassport1StepInputs);
}

Related Project: https://github.com/dog-18/openpassport-rs

@0xturboblitz
Copy link
Member

0xturboblitz commented Sep 6, 2024

@remicolin

looks like deno doesn't like this github link as a package identifier. Not familiar with deno, does it support anything different from npm as sources? @0xisk

@0xisk
Copy link
Author

0xisk commented Sep 6, 2024

@remicolin

looks like deno doesn't like this github link as a package identifier. Not familiar with deno, does it support anything different from npm as sources? @0xisk

Thanks @0xturboblitz for your fast reply. I am not experienced with Deno, but I guess if you could publish your forked version in NPM that would be the easiest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants