Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@temporalio/cloud": "file:packages/cloud",
"@temporalio/common": "file:packages/common",
"@temporalio/create": "file:packages/create-project",
"@temporalio/envconfig": "file:packages/envconfig",
"@temporalio/interceptors-opentelemetry": "file:packages/interceptors-opentelemetry",
"@temporalio/nexus": "file:packages/nexus",
"@temporalio/nyc-test-coverage": "file:packages/nyc-test-coverage",
Expand Down Expand Up @@ -87,6 +88,7 @@
"packages/common",
"packages/core-bridge",
"packages/create-project",
"packages/envconfig",
"packages/interceptors-opentelemetry",
"packages/nexus",
"packages/nyc-test-coverage",
Expand Down
5 changes: 4 additions & 1 deletion packages/client/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,13 @@ function normalizeGRPCConfig(options?: ConnectionOptions): ConnectionOptions {
if (credentials) {
throw new TypeError('Both `tls` and `credentials` ConnectionOptions were provided');
}
const serverRootCert = tls.serverRootCACertificate && Buffer.from(tls.serverRootCACertificate);
const clientCertKey = tls.clientCertPair?.key && Buffer.from(tls.clientCertPair?.key);
const clientCertCrt = tls.clientCertPair?.crt && Buffer.from(tls.clientCertPair?.crt);
return {
...rest,
credentials: grpc.credentials.combineChannelCredentials(
grpc.credentials.createSsl(tls.serverRootCACertificate, tls.clientCertPair?.key, tls.clientCertPair?.crt),
grpc.credentials.createSsl(serverRootCert, clientCertKey, clientCertCrt),
...(callCredentials ?? [])
),
channelArgs: {
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/internal-non-workflow/tls-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export interface TLSConfig {
* Root CA certificate used by the server. If not set, and the server's
* cert is issued by someone the operating system trusts, verification will still work (ex: Cloud offering).
*/
serverRootCACertificate?: Buffer;
serverRootCACertificate?: Uint8Array;
/** Sets the client certificate and key for connecting with mTLS */
clientCertPair?: {
/** The certificate for this client */
crt: Buffer;
crt: Uint8Array;
/** The private key for this client */
key: Buffer;
key: Uint8Array;
};
}

Expand Down
5 changes: 5 additions & 0 deletions packages/envconfig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# `@temporalio/envconfig`

[![NPM](https://img.shields.io/npm/v/@temporalio/envconfig?style=for-the-badge)](https://www.npmjs.com/package/@temporalio/envconfig)

Part of [Temporal](https://temporal.io)'s [TypeScript SDK](https://docs.temporal.io/typescript/introduction/).
42 changes: 42 additions & 0 deletions packages/envconfig/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@temporalio/envconfig",
"version": "0.0.1",
"description": "Temporal.io SDK Environment Configuration sub-package",
"main": "lib/index.js",
"types": "./lib/index.d.ts",
"scripts": {},
"keywords": [
"temporal",
"environment",
"configuration",
"client"
],
"author": "Temporal Technologies Inc. <[email protected]>",
"license": "MIT",
"dependencies": {
"@temporalio/common": "file:../common",
"smol-toml": "1.4.2"
},
"devDependencies": {
"@temporalio/worker": "file:../worker"
},
"engines": {
"node": ">= 18.0.0"
},
"bugs": {
"url": "https://github.com/temporalio/sdk-typescript/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/temporalio/sdk-typescript.git",
"directory": "packages/envconfig"
},
"homepage": "https://github.com/temporalio/sdk-typescript/tree/main/packages/envconfig",
"publishConfig": {
"access": "public"
},
"files": [
"src",
"lib"
]
}
Loading
Loading