Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dpattmann committed Nov 10, 2021
1 parent 6313b2b commit 42c9560
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
Expand Down
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,27 @@ go build cmd/furby/furby.go

### Configuration by configuration file

Configuration can be passed with json or yaml file by command line argument "--path" or "-p". See example configs.
Configuration can be passed with json or yaml file by command line argument "--config" or "-c". See example configs.

## Config

## Example Config

```yaml
---
auth:
type: "noop|user-agent|header"
user-agents: [] # required if type is user-agent
header-name: "" # required if type is header
header-value: [] # required if type is header

credentials:
id: "ClientId"
scopes: []
secret: "ClientSecret"
url: "https://oauth.server/oauth2/token"

store:
interval: 5 # default
stores:
- interval: 5 # time in minutes
path: /token # Handler path
credentials:
id: "ClientId"
scopes: []
secret: "ClientSecret"
url: "https://oauth.server/oauth2/token"
auth:
type: "noop|user-agent|header"
user-agents: [] # required if type is user-agent
header-name: "" # required if type is header
header-value: [] # required if type is header

server:
addr: ":8080" # default
Expand Down
7 changes: 2 additions & 5 deletions cmd/furby/furby.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ import (
flag "github.com/spf13/pflag"
)

var (
authorizer auth.Authorizer
)

func main() {
path := flag.StringP("path", "p", "/etc/furby/config.yaml", "parameter file")
path := flag.StringP("config", "c", "/etc/furby/config.yaml", "config file")
flag.Parse()

c, err := config.NewConfig(*path)
Expand All @@ -42,6 +38,7 @@ func main() {
}
}

var authorizer auth.Authorizer
switch s.Auth.Type {
case "user-agent":
authorizer = auth.NewUserAgentAuthorizer(s.Auth.UserAgents)
Expand Down

0 comments on commit 42c9560

Please sign in to comment.