Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

go-webauthn-js

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

go-webauthn-js - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

go-webauthn.js

23

index.js
const path = require('path');
const fs = require('fs');
require(path.resolve(__dirname, './wasm_exec'));
require(path.resolve(__dirname, './load'));
/** Initialize WASM module and internal server */
/** Initialize JS module and internal server */
function initialize(configuration, callback) {
const go = new Go();
WebAssembly.instantiate(fs.readFileSync(path.resolve(__dirname, './main.wasm')), go.importObject).then((result) => {
go.run(result.instance);
WebAuthnGoWASM.CreateContext(JSON.stringify(configuration), callback);
}).catch((err) => {
callback(err, null);
});
return go;
require(path.resolve(__dirname, './go-webauthn'));
return WebAuthnGoJS.CreateContext(JSON.stringify(configuration), callback);
}

@@ -20,3 +13,3 @@

function beginRegistration(user, callback) {
return WebAuthnGoWASM.BeginRegistration(
return WebAuthnGoJS.BeginRegistration(
JSON.stringify(user),

@@ -29,3 +22,3 @@ (err, data) => callback(err, JSON.parse(data))

function finishRegistration(user, registrationSessionData, registrationBody, callback) {
return WebAuthnGoWASM.FinishRegistration(
return WebAuthnGoJS.FinishRegistration(
JSON.stringify(user),

@@ -40,3 +33,3 @@ JSON.stringify(registrationSessionData),

function beginLogin(user, callback) {
return WebAuthnGoWASM.BeginLogin(
return WebAuthnGoJS.BeginLogin(
JSON.stringify(user),

@@ -49,3 +42,3 @@ (err, data) => callback(err, JSON.parse(data))

function finishLogin(user, authenticationSessionData, authenticationBody, callback) {
return WebAuthnGoWASM.FinishLogin(
return WebAuthnGoJS.FinishLogin(
JSON.stringify(user),

@@ -52,0 +45,0 @@ JSON.stringify(authenticationSessionData),

{
"name": "go-webauthn-js",
"version": "0.0.2",
"version": "0.0.3",
"description": "WebAuthn cross compiled from Go to WASM",

@@ -5,0 +5,0 @@ "main": "index.js",

��# Go-WebAuthn-JS
A go webauthn server library compiled to target WASM. You can run a webauthn server-client in the browser with this!
A go webauthn server library compiled with GopherJS. You can run a webauthn server-client in the browser with this!
Uses [duo-labs/webauthn](https://github.com/duo-labs/webauthn) as the primary library, and borrows heavily from the [webauthn example](https://github.com/hbolimovsky/webauthn-example).
Uses [my fork of duo-labs/webauthn](https://github.com/pulsejet/webauthn) as the primary library, removing some features to trim down the size and replacing libraries with slimmer ones, and borrows heavily from the [webauthn example](https://github.com/hbolimovsky/webauthn-example).

@@ -15,6 +15,13 @@ ## Usage

## Compiling
You will need Go 1.14+ to compile to WASM
Compile with gopherjs, and optionally minify with the closure compiler
```
gopherjs build -o go-webauthn.js
java -jar ./closure.jar --js ./go-webauthn.js --js_output_file go-webauthn.min.js
```
## WASM Target
The project initially targeted WASM. You will need Go 1.14+ to compile.
```
GOOS=js GOARCH=WASM go build -o main.wasm
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc