trustpilot / node-trustpilot

HTTP client for Trustpilot
MIT License
31 stars 4 forks source link

Remove username and password #46

Closed anjmao closed 6 years ago

anjmao commented 6 years ago

As we already have api keys management in B2B site I think we should to remove username and password fields from api.

let client = new Trustpilot(
  {
    apiKey: 'YOUR-API-KEY',
    secret: 'YOUR-SECRET',
    username: 'YOUR-TRUSTPILOT-B2B-USERNAME', // <-remove this
    password: 'YOUR-TRUSTPILOT-B2B-PASSWORD' // <-remove this
  });

Note: this is breaking change and release number should be updated accordingly to follow semver.

b-dur commented 6 years ago

This package is not only used for our b2b site. Other users outside of TP are also using this module, and username and password are needed in cases, when they want to access the private endpoints.

However, I would like to see the AccessProvider was more modular, so it was possible to change to a different provider. Say a b2b AccessProvider which could accept an apiKey and an accessToken, and that provider could also handle refreshToken communication if needed. Another example could be, another simpler AccessProvider, that only allowed accessing public API endpoints.

martinbuberl commented 6 years ago

@anjmao Does Bardur answer it? Can I close the issue?

b-dur commented 6 years ago

@martinbuberl guess we can close this issue.