Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
babarot committed Nov 22, 2017
1 parent c283339 commit acb0e80
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
iap_curl
========

curl wrapper for making HTTP request to IAP-protected app in CLI more easier than curl
iap_curl is a curl wrapper for making HTTP request to IAP-protected app in CLI more easier than curl

## Usage

```console
$ export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
$ export IAP_CLIENT_ID="342624545358-asdfd8fas9df8sd7ga0sdguadfpvqp69.apps.googleusercontent.com"
$
$ iap_curl http://iap-protected.webapp.com
```

The option of iap_curl is fully compatible with curl one.
The options of `iap_curl` are fully compatible with curl.

If you want to use [httpstat](https://github.com/b4b4r07/httpstat), please specify the `IAP_CURL_BIN` environment variable:

Expand Down Expand Up @@ -47,6 +46,37 @@ Body discarded
total:684ms
```

## Advanced usage

You can save the URL of frequently used service together with its Env (`IAP_CLIENT_ID` ...) in a JSON file (see also [#1](https://github.com/b4b4r07/iap_curl/issues/1)). This file is located in `~/.config/iap_curl/config.json`.

```json
{
"service": [
{
"url": "https://my.service.com/health",
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/Users/b4b4r07/Downloads/my-service-dev-b5e624fd28ee.json",
"IAP_CLIENT_ID": "839558305167-s3akt4doo38lckhaac1ucfdp0e4921tc.apps.googleusercontent.com",
"IAP_CURL_BIN": "curl"
}
}
]
}
```

Thanks to that, you can access more easier like curl.

```console
$ iap_curl https://my.service.com/health
```

Also, some original options are added. So you can use more and more easier to access the service by using [peco](https://github.com/peco/peco)/[fzf](https://github.com/junegunn/fzf). For more information about its options, please see `iap_curl --help`.

```console
$ iap_curl $(iap_curl --list-urls | peco) # peco is similar to fzf
```

## Installation

```
Expand Down

0 comments on commit acb0e80

Please sign in to comment.