smartystreets / smartystreets-java-sdk

The official client libraries for accessing SmartyStreets APIs from Java (and JRE-based languages)
https://smartystreets.com/docs/sdk/java
14 stars 18 forks source link

feature: add EmbeddedKeyCredentials request signer #24

Closed eduard-romaniuk closed 2 years ago

eduard-romaniuk commented 2 years ago

Hi! I propose to add a class that will add to request embedded key (aka website key) without hostname.

Use case:

I want to use US Autocomplete Pro on my server. This API doesn't support server keys, so I need to use an embedded key instead. But SmartyStreets have security rate limits for embedded keys, so one IP cannot spam requests. Documentation advises whitelist IP to bypass security limits. But SmartyStreets looks at hostname instead of IP if it specified (saw that on practice), so I should specify server IP in the hostname or just don't specify a hostname.

joliver commented 2 years ago

The intended use case is interactive with someone at the keyboard inspecting the response and not for server-to-server interactions.

eduard-romaniuk commented 2 years ago

@joliver Sorry, I didn't get what you mean

joliver commented 2 years ago

The purpose of the US Autocomplete Pro API is for end users to call that endpoints API directly. We don't intend for direct server calls. This is part of the reason why it's not enabled that way in the SDKs.

eduard-romaniuk commented 2 years ago

@joliver Yeah, I know. But anyway you have a workaround for this (IP whitelisting), so I thought it would be great to have this possibility in SDK as well.

joliver commented 2 years ago

There's a reason we don't have that in the SDK:

https://www.smartystreets.com/legal/licenses/us-autocomplete-pro

The US Autocomplete Pro product is intended to be used by individual natural persons (“Consumers”) and not by automated or computer assisted means or devices. Input of address queries are to be interactively submitted by a Consumer keystroke by keystroke to arrive at a given result and it is anticipated that the results are viewed by a Consumer.

eduard-romaniuk commented 2 years ago

Okay