Skip to content

Commit

Permalink
First draft of the Fugue client
Browse files Browse the repository at this point in the history
  • Loading branch information
curtis-fugue committed Jul 31, 2019
1 parent 1f0f4cc commit 62bc75e
Show file tree
Hide file tree
Showing 120 changed files with 14,555 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
vendor/

.vscode
fugue
swagger.yaml
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

GO=GO111MODULE=on go
BINARY=fugue
SWAGGER=swagger.yaml
SWAGGER_URL=https://api.riskmanager.fugue.co/v0/swagger
SOURCES=$(shell find . -name '*.go')
GOPATH?=$(shell echo "$$HOME")/go

$(BINARY): $(SOURCES)
$(GO) build -v -o fugue

.PHONY: install
install: $(BINARY)
cp $(BINARY) $(GOPATH)/bin/

$(SWAGGER):
wget -q -O $(SWAGGER) $(SWAGGER_URL)

.PHONY: validate
validate: $(SWAGGER)
swagger validate $(SWAGGER)

.PHONY: gen
gen: $(SWAGGER)
swagger generate client -f $(SWAGGER)
sed -i "" "s/,omitempty//g" $(shell find models -name "*.go")

.PHONY: clean
clean:
rm -f $(BINARY)
91 changes: 91 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Fugue API Client

This is a command line client for the Fugue API.

For information about enabling a client in your account, see
[the documenation](https://riskmanagerdocs.fugue.co/api.html). More details of the underlying Swagger API are available
[here](https://riskmanagerdocs.fugue.co/Resources/API/swagger.html).

This project is under active development and is not yet stable. Commands will
change as we incorporate feedback.

## Environment Variables

The client uses the following *required* environment variables:

* `FUGUE_API_ID` - your API client ID
* `FUGUE_API_SECRET` - your API client secret

## Build

Build the client executable:

```
make build
```

Install to $GOPATH/bin:

```
make install
```

## Usage

Show usage:

```
fugue -h
```

Show usage for a subcommand:

```
fugue list -h
```

List environments:

```
fugue list environments
```

List environment scans:

```
fugue list scans [environment-id]
```

List environment events:

```
fugue list events [environment-id]
```

Trigger a scan:

```
fugue scan [environment-id]
```

Compliance by resource types:

```
fugue get compliance-by-resource-types [scan-id]
```

Compliance by rules:

```
fugue get compliance-by-rules [scan-id]
```

## Aliases

You may use the shorthand `env` instead of `environment` when running commands.

For example:

```
fugue list envs
```
139 changes: 139 additions & 0 deletions client/environments/create_environment_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 62bc75e

Please sign in to comment.