Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ikemtz/pubeler
A utility to post data contained in flat files to RESTful apis.
https://github.com/ikemtz/pubeler
auth0 device-workflow flat-files oauth2
Last synced: 2 months ago
JSON representation
A utility to post data contained in flat files to RESTful apis.
- Host: GitHub
- URL: https://github.com/ikemtz/pubeler
- Owner: ikemtz
- License: mit
- Created: 2019-10-09T14:50:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-16T23:31:55.000Z (10 months ago)
- Last Synced: 2024-10-21T16:47:51.298Z (3 months ago)
- Topics: auth0, device-workflow, flat-files, oauth2
- Language: TypeScript
- Homepage:
- Size: 143 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pubeler
pronounced pyüb-lər
A utility to automate the publishing of data contained in flat files to resful APIs. At this time this is setup to use device OAuth workflow.
## installation
```
npm install --global pubeler
```or
```
npm i -g pubeler
```## running it
`pubeler --configFile --dataFile `
#### Note: This application uses the device workflow, so you will need to complete the authentication process with your identity provider.
## getting help
`pubeler --help`
If this doesn't provide what you need, feel free to submit a new issue ticket [here](https://github.com/ikemtz/pubeler/issues/new).
## enabling OAuth debugging (--oauthDebug)
`pubeler --configFile --dataFile --oauthDebug`
This will write out the aquired jwt from the oauth provider to the console.
## config file
This is a JSON file that will inform Pubeler on how to authenticate with your identity provider and communicate with your APIs.
Here's a sample:
```
{
"textDelimeter": "\t",
"postDestinationUrl": "https://my-post-url.com/api/myrecords.json",
"oauth_client_id": "my-client-id",
"oauth_device_code_url": "https://{tenant-name}.auth0.com/oauth/token",
"oauth_token_url": "https://{tenant-name}.auth0.com/oauth/token",
"oauth_audience": "{your-audience}",
"oauth_scope": "openid",
// This is an optional setting, only to be used when absolutely necessary
"skip_ssl_validation": false,
}
```#### Note: Your identity provider has to support the device workflow. I recommend using [Auth0](https://auth0.com/docs/flows/concepts/device-auth) as they have an easy to use implementation of this workflow.
## error handling
If a post related error occurs, a new txt file will be created containing the records that caused an error response (HTTP 400-500 response codes.) This file will allow you to easily retry failed records in a subsequent run. The generated text file name will be named: `{url pathinfo}.{timestamp (yyMMddHHmmss)}.failures.txt`. An example of this would be: myrecords.json.221208011433.failures.txt.
The server response which typically indicates why the post request failed will be logged to the console. Additionally, authentication/OAuth related errors will be logged to the console as well.