Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ssl pfx auth #38

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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
);


export { Client, IOptions } from 'soap';

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