sdk-typescript icon indicating copy to clipboard operation
sdk-typescript copied to clipboard

[Feature Request] Allow strings to be passed for `tls.clientCertPair.crt/key`

Open lorensr opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe.

So that I don't have to use Buffer.from with env vars:

image

lorensr avatar Jan 06 '23 03:01 lorensr

Not sure. If we expect a string, people are likely to believe that they can give a file path. This might actually be more problematic than the status quo.

@lorensr What do you think?

mjameswh avatar Jan 20 '23 01:01 mjameswh

I see your point. I'd prioritize convenience here, and change doc to clarify:

crt Buffer | string The cert itself (not a file path).

image

lorensr avatar Jan 20 '23 03:01 lorensr

I'd consider adding support for strings but warning if the string looks like a path.

bergundy avatar Jan 20 '23 19:01 bergundy

Another option is to support:

Buffer | { content: string | Buffer } | { path: string }

That could help direct users in the right direction and remove some friction but I don't love it.

bergundy avatar Jan 20 '23 21:01 bergundy

Another option is to support:

Buffer | { content: string | Buffer } | { path: string }

That could help direct users in the right direction and remove some friction but I don't love it.

Don't really love it either, but I'd say this is the "least worst" option, and is quite easy to implement anyway.

Will do.

mjameswh avatar Jan 24 '23 01:01 mjameswh

I’m on the fence… let’s think about it some more

bergundy avatar Jan 24 '23 05:01 bergundy