-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
533 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
[VERSION] | ||
|
||
# ⚠️ Breaking Changes | ||
|
||
- The built-in template function `base64url` has been renamed to `base64Url` for better naming consistency. [#48] | ||
|
||
- The built-in template functions `base64` and `base64Url` do now encode strings to Base64 **with leading padding**. If you want to encode without padding, use the new functions `base64Unpadded` and `base64UrlUnpadded`. [#48] | ||
|
||
- The previously deprecated alias `headers` for the `header` request section has now been removed. | ||
|
||
# New Features | ||
|
||
- A new template function `json` has been added which encodes any passed object into a JSON string (e.g. `{{ json .myObject }}`). | ||
- | ||
- For each in-script logging function, a formatted equivalent has been added (e.g. `infof("Hello, %s!", "world")`). | ||
- Requesting HTTPS endpoints with self-signed certificates is now possible. [#49, #51] | ||
*That means, that the certificate validity is **not checked by default**. You can pass the `--secure` flag or set the `GOATARG_SECURE=true` environment variable to enable certificate validation.* | ||
|
||
# Minor Changes and Bug Fixes | ||
|
||
- Variables set in the `PreScript` section are now available for substitution in all other parts of the request like URL, options, header, body or script. [#43] | ||
- Fixed a bug causing a panic when multiple Goatfiles are passed and one or more of these files do not exist. Now, a proper error message is returned. | ||
|
||
- Fixed a bug which caused a panic when invalid key-value paris have been passed via the `--args` flag. [#49] | ||
|
||
- Section log lines are now hidden when a Goatfile is executed via the `execute` instruction. | ||
- When running with the `DEBUG` logging level, the parsed Goatfile is now only printed to log output if the `--dry` flag is passed. | ||
|
||
- Some more debugging information has been added visible when using the `trace` log level. | ||
- Some command line parameters now got respective environment variables to set them. These are prefixed with `GOATARG_` and can be viewed in the `--help` overview. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM golang:alpine AS build | ||
WORKDIR /build | ||
COPY .git/ .git/ | ||
COPY cmd/ cmd/ | ||
COPY internal/ internal/ | ||
COPY pkg/ pkg/ | ||
COPY scripts/ scripts/ | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN ash scripts/version.sh | ||
RUN go build -v -o bin/goat cmd/goat/main.go | ||
|
||
FROM alpine | ||
LABEL org.opencontainers.image.authors="B12-Touch GmbH (hello@b12-touch.de)" \ | ||
org.opencontainers.image.url="https://github.com/studio-b12/goat" \ | ||
org.opencontainers.image.source="https://github.com/studio-b12/goat" \ | ||
org.opencontainers.image.licenses="BSD-Clause-3" | ||
COPY --from=build /build/bin/goat /bin/goat | ||
ENTRYPOINT ["/bin/goat"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Auth | ||
|
||
> *RequestOptions* : | ||
> `[Auth]` `NL`+ *RequestAuthContent* | ||
> | ||
> *RequestAuthContent* : | ||
> *TomlKeyValues* | ||
## Example | ||
|
||
```toml | ||
[Auth] | ||
username = "foo" | ||
password = "{{.credentials.password}}" | ||
``` | ||
|
||
## Explanation | ||
|
||
Auth is a utility block for easily defining basic or token authorization. When defined, the `Authorization` header will | ||
be set accordingly to the request. | ||
|
||
## Basic Auth | ||
|
||
If you want to add basic auth to your request, simply define a `username` and `password`. If **both** values are set, | ||
the username and password are joined by a `:` and encoded using end-padded base64. The encoded value is then set to the | ||
`Authorization` header using the `basic` auth type (as defined in | ||
[RFC 7671](https://www.rfc-editor.org/rfc/rfc7617)). | ||
|
||
> **Example** | ||
> ```toml | ||
> [Auth] | ||
> username = "foo" | ||
> password = "bar" | ||
> ``` | ||
> his input will result in the following header. | ||
> ``` | ||
> Authorization: basic Zm9vOmJhcg== | ||
> ``` | ||
## Token Auth | ||
You can also specify a `token` set as `Authorization` header. If defined, the token will be prefixed with | ||
a token `type`. | ||
> **Example** | ||
> ```toml | ||
> [Auth] | ||
> type = "bearer" | ||
> token = "foobarbaz" | ||
> ``` | ||
> This input will result in the following header. | ||
> ``` | ||
> Authorization: bearer foobarbaz | ||
> ``` | ||
> | ||
> ```toml | ||
> [Auth] | ||
> token = "foobarbaz" | ||
> ``` | ||
> This input will result in the following header. | ||
> ``` | ||
> Authorization: foobarbaz | ||
> ``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.