Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Improve OAuth1 support #34

Merged
merged 4 commits into from
Jul 1, 2019

Conversation

bookmoons
Copy link
Contributor

Raises a descriptive error if insufficient OAuth1 configuration is available. I'm not finding a clear description of which config is required. Went for the set that's nearest I could tell:

To convert this collection provide OAuth credentials. Either include them in the collection or use the --oauth1-* CLI options. Minimum required configuration is signature method, consumer key, consumer secret, access token, and token secret.

Adds command line options for specifying OAuth1 configuration. CLI options override settings in the collection.

  --oauth1-consumer-key <value>      OAuth1 consumer key.
  --oauth1-consumer-secret <value>   OAuth1 consumer secret.
  --oauth1-access-token <value>      OAuth1 access token.
  --oauth1-token-secret <value>      OAuth1 token secret.
  --oauth1-signature-method <value>  OAuth1 signature method. One of HMAC-SHA1 HMAC-SHA256 PLAINTEXT.
  --oauth1-timestamp <value>         OAuth1 timestamp.
  --oauth1-nonce <value>             OAuth1 nonce.
  --oauth1-version <value>           OAuth1 version.
  --oauth1-realm <value>             OAuth1 realm.

This command converts the twitter.json example:

node bin/postman-to-k6.js example/v2/twitter.json --oauth1-signature-method HMAC-SHA256 --oauth1-consumer-key ConsumerKey --oauth1-consumer-secret ConsumerSecret --oauth1-access-token AccessToken --oauth1-token-secret TokenSecret

Closes #20.

Raises a descriptive error if insufficient configuration provided.
Adds command line options for specifying OAuth1 configuration.
CLI options override settings in the collection.
@robingustafsson
Copy link
Member

LGTM, merging. Thanks @bookmoons!

@robingustafsson robingustafsson merged commit bc1a277 into grafana:master Jul 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unrecognized OAuth 1.0 signature method: undefined
2 participants