Skip to content

Add ssl pfx auth#38

Open
SharonFabin wants to merge 1 commit intolehh:mainfrom
SharonFabin:ssl-pfx-auth
Open

Add ssl pfx auth#38
SharonFabin wants to merge 1 commit intolehh:mainfrom
SharonFabin:ssl-pfx-auth

Conversation

@SharonFabin
Copy link

No description provided.

Copy link
Owner

@lehh lehh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @SharonFabin. Thanks for the PR! Also thanks for it to be based on the NTLM PR.

I've left a couple comments and I also ask you to add tests in the soap.service.spec.ts like this as an example

export type SSLPFXOptions = {
pfx: string | Buffer;
passphrase?: string;
defaults?: any;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about typing this AgentOptions from the https module?

passphrase: SSLPFXOptions.passphrase,
...SSLPFXOptions.defaults,
};
return new ClientSSLSecurityPFX(loginData);
Copy link
Owner

@lehh lehh Apr 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is working? The ClientSSLSecurityPFX expects two or three args in the constructor and it's receiving only one. The typescript is not warning because the loginData is of any type and then it gets confused 🤷🏻.

I believe it would be better to do something like:

return new ClientSSLSecurityPFX(
  SSLPFXOptions.pfx,
  SSLPFXOptions.passphrase,
  SSLPFXOptions.defaults
);

interface Auth {
type: typeof BASIC_AUTH | typeof WSSECURITY_AUTH;
type: typeof BASIC_AUTH | typeof WSSECURITY_AUTH | typeof SSL_PFX_AUTH;
username: string;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the username and password should be turned into optional now, since it seems the SSL PFX doesn't require them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants