-
Notifications
You must be signed in to change notification settings - Fork 41
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
Added generic connector for Twitter API #1285
Conversation
I am currently having some issues trying to generate a valid request using OAuth1 and Curl. Twitter says in their docs you can make a curl request using OAuth1 like this after creating a Twitter development account:
However, this request results in When I added I used Postman to generate a request, which gave back a valid result using OAuth1. In Postman, you can export what the request looks like in a variety of languages, including Curl. That exported request looks like this:
This is a valid request. I can't figure out how to make a CURL request using what Twitter provided in their documentation, since the parameters are the same. If there was a way to incorporate these parameters in the Authorization header, we could use the generic HTTP config in Secretless as it currently is. It looks like this method may need to use query parameters, and may be another use-case of Secretless being able to integrate secure body parameters. |
f8e247b
to
9b21d0f
Compare
|
||
The configuration file for the Splunk Web API can be found at [twitter_secretless.yml](./twitter_secretless.yml). | ||
|
||
**Note:** This configuration currently only supports connecting to the Twitter API via OAuth2. An issue can be found here for adding an OAuth1 Connector for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line length
Twitter. | ||
|
||
#### How to use this connector | ||
* Edit the supplied service configuration to get your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lists should be surrounded by blank lines
#### How to use this connector | ||
* Edit the supplied service configuration to get your | ||
[OAuth token](https://developer.twitter.com/en/docs/basics/authentication/oauth-2-0/bearer-tokens) | ||
* Run secretless with the supplied configuration(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lists should be surrounded by blank lines
<ol> | ||
<li> | ||
Get your | ||
<a href="https://developer.twitter.com/en/apps"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline HTML
</li> | ||
<li> | ||
Get an | ||
<a href="https://developer.twitter.com/en/docs/basics/authentication/oauth-2-0/bearer-tokens"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline HTML
9b21d0f
to
8fe254c
Compare
Note: An OAuth1 service could not be supported in this PR. There is an outstanding issue for an OAuth1 connector here. |
|
||
The configuration file for the Splunk Web API can be found at [twitter_secretless.yml](./twitter_secretless.yml). | ||
|
||
**Note:** This configuration currently only supports connecting to the Twitter API via OAuth2. An issue can be found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should try to respect line length limits when possible - I'd break this into two lines
<br /> | ||
'https://api.twitter.com/oauth2/token' | ||
</code> | ||
<li>Save the local token from the request into the OSX keychain</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline HTML
<br /> | ||
--data 'grant_type=client_credentials' \ | ||
<br /> | ||
'https://api.twitter.com/oauth2/token' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bare URL used
Twitter API key and Secret Key | ||
</a> | ||
</li> | ||
<li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bare URL used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a few small things stood out
|
||
The configuration file for the Splunk Web API can be found at [twitter_secretless.yml](./twitter_secretless.yml). | ||
|
||
**Note:** This configuration currently only supports connecting to the Twitter API via OAuth2. An issue can be found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should try to respect line length limits when possible - I'd break this into two lines
8fe254c
to
da0ab23
Compare
@@ -23,9 +24,13 @@ If your target uses self-signed certs you will need to follow the | |||
[documented instructions](https://docs.secretless.io/Latest/en/Content/References/connectors/scl_handlers-https.htm#Manageservercertificates) for adding the | |||
target’s CA to Secretless’ trusted certificate pool. | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple consecutive blank lines
> Note: The following examples use the [Keychain provider](https://docs.cyberark.com/Product-Doc/OnlineHelp/AAM-DAP/11.3/en/Content/References/providers/scl_keychain.htm?TocPath=Fundamentals%7CSecretless%20Pattern%7CSecret%20Providers%7C_____5). | ||
> Replace the service prefix `service#` with an appropriate service | ||
> or use a different provider as needed. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank line inside blockquote
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One formatting thing and one nit
da0ab23
to
60170ca
Compare
@@ -127,10 +134,13 @@ depending on if your endpoint requires JSON or URL encoded requests | |||
|
|||
#### Example Usage | |||
<details> | |||
<summary><b>How to use this connector locally...</b></summary> | |||
<summary><b>Example setup to try this out locally...</b></summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline HTML
73f5a67
to
c4b404d
Compare
3783a03
to
5e504dc
Compare
one should be used. | ||
|
||
#### How to use this connector | ||
* Get the [Stripe API Key](https://dashboard.stripe.com/apikeys), which can be used as a Bearer token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line length
|
||
#### How to use this connector | ||
* Get the [Stripe API Key](https://dashboard.stripe.com/apikeys), which can be used as a Bearer token | ||
* Get a [connected account](https://stripe.com/docs/connect/authentication) or generate an [idempotency key](https://stripe.com/docs/api/idempotent_requests) if needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line length
one should be used. | ||
|
||
#### How to use this connector | ||
* Get the [Stripe API Key](https://dashboard.stripe.com/apikeys), which can be used as a Bearer token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lists should be surrounded by blank lines
|
||
#### Example Usage | ||
<details> | ||
<summary><b>Example setup to try this out locally</b></summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline HTML
|
||
#### Example Usage | ||
<details> | ||
<summary><b>Example setup to try this out locally</b></summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline HTML
</code> | ||
<li> | ||
Store the token from your request in your local credential manager so | ||
that it may be retrieved in your <code>secretless.yml</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline HTML
3dc0207
to
2fba078
Compare
|
||
#### Example Usage | ||
<details> | ||
<summary><b>Example setup to try this out locally</b></summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline HTML
|
||
#### Example Usage | ||
<details> | ||
<summary><b>Example setup to try this out locally</b></summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline HTML
</code> | ||
<li> | ||
Store the token from your request in your local credential manager so | ||
that it may be retrieved in your <code>secretless.yml</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline HTML
Code Climate has analyzed commit 2fba078 and detected 27 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 49.8% (0.0% change). View more on Code Climate. |
What does this PR do?
What ticket does this PR close?
Connected to #1264
Checklists
Change log
Test coverage
Documentation
README
s) were updated in this PR, and/or there is a follow-on issue to update docs(For releases only) Manual tests