@relaycorp/relaynet-core
Advanced tools
Comparing version 1.85.0 to 1.86.0
@@ -22,8 +22,4 @@ "use strict"; | ||
async makeMessage(payload, messageConstructor, options = {}) { | ||
const recipient = { | ||
id: this.peer.id, | ||
internetAddress: this.peer.internetAddress, | ||
}; | ||
const payloadSerialised = await this.wrapMessagePayload(payload); | ||
const message = new messageConstructor(recipient, this.deliveryAuthPath.leafCertificate, Buffer.from(payloadSerialised), { | ||
const message = new messageConstructor(this.getOutboundRAMFRecipient(), this.deliveryAuthPath.leafCertificate, Buffer.from(payloadSerialised), { | ||
...options, | ||
@@ -30,0 +26,0 @@ senderCaCertificateChain: this.deliveryAuthPath.certificateAuthorities, |
@@ -10,2 +10,3 @@ import { Certificate } from '../crypto/x509/Certificate'; | ||
import { ChannelConstructor } from './channels/ChannelConstructor'; | ||
import { Channel } from './channels/Channel'; | ||
export declare abstract class Node<Payload extends PayloadPlaintext, PeerAddress extends PeerInternetAddress> { | ||
@@ -40,2 +41,3 @@ readonly id: string; | ||
unwrapMessagePayload<P extends Payload>(message: RAMFMessage<P>): Promise<P>; | ||
getChannel(peerId: string, peerInternetAddress: PeerAddress): Promise<Channel<Payload, PeerAddress> | null>; | ||
} |
@@ -59,4 +59,20 @@ "use strict"; | ||
} | ||
async getChannel(peerId, peerInternetAddress) { | ||
const internetGatewayPublicKey = await this.keyStores.publicKeyStore.retrieveIdentityKey(peerId); | ||
if (!internetGatewayPublicKey) { | ||
return null; | ||
} | ||
const privateGatewayDeliveryAuth = await this.keyStores.certificateStore.retrieveLatest(this.id, peerId); | ||
if (!privateGatewayDeliveryAuth) { | ||
return null; | ||
} | ||
const internetGateway = { | ||
id: peerId, | ||
identityPublicKey: internetGatewayPublicKey, | ||
internetAddress: peerInternetAddress, | ||
}; | ||
return new this.channelConstructor(this, internetGateway, privateGatewayDeliveryAuth, this.keyStores, this.cryptoOptions); | ||
} | ||
} | ||
exports.Node = Node; | ||
//# sourceMappingURL=Node.js.map |
@@ -23,3 +23,2 @@ import { Certificate } from '../crypto/x509/Certificate'; | ||
saveInternetGatewayChannel(deliveryAuthorization: Certificate, internetGatewayIdentityCertificate: Certificate, internetGatewaySessionPublicKey: SessionKey): Promise<void>; | ||
retrieveInternetGatewayChannel(internetGatewayId: string, internetGatewayInternetAddress: string): Promise<PrivateInternetGatewayChannel | null>; | ||
} |
@@ -44,20 +44,4 @@ "use strict"; | ||
} | ||
async retrieveInternetGatewayChannel(internetGatewayId, internetGatewayInternetAddress) { | ||
const internetGatewayPublicKey = await this.keyStores.publicKeyStore.retrieveIdentityKey(internetGatewayId); | ||
if (!internetGatewayPublicKey) { | ||
return null; | ||
} | ||
const privateGatewayDeliveryAuth = await this.keyStores.certificateStore.retrieveLatest(this.id, internetGatewayId); | ||
if (!privateGatewayDeliveryAuth) { | ||
return null; | ||
} | ||
const internetGateway = { | ||
id: internetGatewayId, | ||
identityPublicKey: internetGatewayPublicKey, | ||
internetAddress: internetGatewayInternetAddress, | ||
}; | ||
return new PrivateInternetGatewayChannel_1.PrivateInternetGatewayChannel(this, internetGateway, privateGatewayDeliveryAuth, this.keyStores, this.cryptoOptions); | ||
} | ||
} | ||
exports.PrivateGateway = PrivateGateway; | ||
//# sourceMappingURL=PrivateGateway.js.map |
{ | ||
"name": "@relaycorp/relaynet-core", | ||
"version": "1.85.0", | ||
"version": "1.86.0", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "email": "no-reply@relaycorp.tech", |
Sorry, the diff of this file is too big to display
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5690207
6842