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

@trinsic/trinsic

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trinsic/trinsic - npm Package Compare versions

Comparing version 1.6.1-rc1 to 1.6.1-rc2

lib/OkapiProvider.d.ts

16

lib/AccountService.js

@@ -9,4 +9,4 @@ "use strict";

const proto_1 = require("./proto");
const okapi_1 = require("@trinsic/okapi");
const base64url_1 = __importDefault(require("base64url"));
const OkapiProvider_1 = require("./OkapiProvider");
class AccountService extends ServiceBase_1.default {

@@ -26,6 +26,3 @@ constructor(options) {

let cloned = proto_1.AccountProfile.fromPartial(profile);
const result = await okapi_1.Oberon.blindToken({
blinding: [securityCode],
token: cloned.authToken,
});
const result = await (0, OkapiProvider_1.blindOberon)(cloned, securityCode);
cloned.authToken = result.token;

@@ -47,6 +44,3 @@ cloned.protection = proto_1.TokenProtection.fromPartial({

let cloned = proto_1.AccountProfile.fromPartial(profile);
const result = await okapi_1.Oberon.unblindToken({
token: cloned.authToken,
blinding: [securityCode],
});
const result = await (0, OkapiProvider_1.unblindOberon)(cloned, securityCode);
cloned.authToken = result.token;

@@ -91,6 +85,6 @@ cloned.protection = proto_1.TokenProtection.fromPartial({

authCode = AccountService.convertToUtf8(authCode);
let hashed = await okapi_1.Hashing.blake3Hash({ data: authCode });
let digest = await (0, OkapiProvider_1.blake3HashRequest)(authCode);
let response = await this.client.loginConfirm({
challenge: challenge,
confirmationCodeHashed: hashed.digest,
confirmationCodeHashed: digest,
});

@@ -97,0 +91,0 @@ if (response.profile === undefined) {

@@ -7,6 +7,6 @@ "use strict";

const proto_1 = require("./proto");
const okapi_1 = require("@trinsic/okapi");
const nice_grpc_common_1 = require("nice-grpc-common");
const base64url_1 = __importDefault(require("base64url"));
const nice_grpc_web_1 = require("nice-grpc-web");
const OkapiProvider_1 = require("./OkapiProvider");
class ServiceBase {

@@ -35,21 +35,11 @@ constructor(options = proto_1.ServiceOptions.fromPartial({})) {

}
const requestData = request;
let requestHash = new Uint8Array();
if (requestData.length > 0) {
let hashResponse = await okapi_1.Hashing.blake3Hash({ data: requestData });
requestHash = hashResponse.digest;
}
const requestHash = await (0, OkapiProvider_1.blake3HashRequest)(request);
const timestamp = Date.now();
let nonce = { timestamp: timestamp, requestHash: requestHash };
const nonceUint8 = proto_1.Nonce.encode(nonce).finish();
let proof = await okapi_1.Oberon.createProof({
data: profile.authData,
nonce: nonceUint8,
token: profile.authToken,
blinding: [],
});
const proof = await (0, OkapiProvider_1.oberonProofRequest)(profile, nonceUint8);
const metadata = new nice_grpc_common_1.Metadata();
metadata.append("authorization", `Oberon ` +
`ver=1,` +
`proof=${(0, base64url_1.default)(Buffer.from(proof.proof))},` +
`proof=${(0, base64url_1.default)(Buffer.from(proof))},` +
`data=${(0, base64url_1.default)(Buffer.from(profile.authData))},` +

@@ -56,0 +46,0 @@ `nonce=${(0, base64url_1.default)(Buffer.from(nonceUint8))}`);

{
"name": "@trinsic/trinsic",
"version": "1.6.1-rc1",
"version": "1.6.1-rc2",
"description": "Node and Browser wrapper for the Trinsic services",
"browser": {
"@trinsic/okapi-node": "@trinsic/okapi-web"
},
"main": "lib/index.js",

@@ -37,3 +40,4 @@ "types": "lib/index.d.ts",

"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
"@trinsic/okapi": "1.6.0",
"@trinsic/okapi-node": "^1.6.1-rc1",
"@trinsic/okapi-web": "^1.6.1-rc1",
"assert": "^2.0.0",

@@ -40,0 +44,0 @@ "base64url": "^3.0.1",

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