Socket
Socket
Sign inDemoInstall

@0xpass/passport

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xpass/passport - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

6

CHANGELOG.md
# @0xpass/passport
## 2.0.5
### Patch Changes
- c3ad73a: Keysigner viem client compatibility
## 2.0.4

@@ -4,0 +10,0 @@

@@ -52,2 +52,11 @@ import { AuthenticationParams, AuthenticationResponse, DelegatedRegisterAccountParams, DelegatedRegisterAccountResponse, LambaCallParams, LambdaNewParams, Method, NewScopeParams, NewScopeResponse, RegistrationParams, RegistrationResponse, RpcHeaders, RpcMethodParams, SignMessageParams, SignMessageResponse, SignTransactionParams, SignTransactionResponse, UpdateScopeParams, UpdateScopeResponse } from "./types";

/**
* Gets authenticated headers for a request.
*/
getDelegatedAuthenticatedHeaders(): Promise<{
[x: string]: string;
"X-Encrypted-User": string;
"X-Encrypted-Key": string;
"X-Scope-Id": string;
}>;
/**
* Gets account address from the passport node.

@@ -54,0 +63,0 @@ */

@@ -367,2 +367,21 @@ import axios from 'axios';

/**
* Gets authenticated headers for a request.
*/
async getDelegatedAuthenticatedHeaders() {
if (!this.userData) {
throw new Error("User data must be set before proceeding.");
}
const encrypted_user = await aesEncrypt(JSON.stringify(this.userData), this.aesKey);
const signature = await this.signer.sign(encrypted_user);
const encrypted_signature = await aesEncrypt(JSON.stringify(signature), this.aesKey);
const header = this.signer.getHeaderName();
const headers = {
"X-Encrypted-User": encrypted_user,
"X-Encrypted-Key": this.encryptedAesKey,
"X-Scope-Id": this.scopeId,
[header]: encrypted_signature,
};
return headers;
}
/**
* Gets account address from the passport node.

@@ -369,0 +388,0 @@ */

2

package.json
{
"name": "@0xpass/passport",
"version": "2.0.4",
"version": "2.0.5",
"description": "",

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

@@ -29,3 +29,3 @@ import axios from "axios";

import { SignerWithOptionalCreator } from "./types/credential";
import { CredentialCreator, KeyAssertion } from "@0xpass/models";
import { CredentialCreator } from "@0xpass/models";
import {

@@ -181,2 +181,26 @@ aesDecrypt,

/**
* Gets authenticated headers for a request.
*/
public async getDelegatedAuthenticatedHeaders() {
if (!this.userData) {
throw new Error("User data must be set before proceeding.");
}
const encrypted_user = await aesEncrypt(JSON.stringify(this.userData), this.aesKey);
const signature = await this.signer.sign(encrypted_user);
const encrypted_signature = await aesEncrypt(JSON.stringify(signature), this.aesKey);
const header: SignatureHeader = this.signer.getHeaderName() as SignatureHeader;
const headers = {
"X-Encrypted-User": encrypted_user,
"X-Encrypted-Key": this.encryptedAesKey,
"X-Scope-Id": this.scopeId,
[header]: encrypted_signature,
};
return headers;
}
/**
* Gets account address from the passport node.

@@ -183,0 +207,0 @@ */

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