Skip to content

Commit

Permalink
Remove config sub-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-schulz committed Mar 28, 2024
1 parent cb04cbe commit 3801405
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 127 deletions.
29 changes: 0 additions & 29 deletions cmd/config/check.go

This file was deleted.

16 changes: 0 additions & 16 deletions cmd/config/config.go

This file was deleted.

28 changes: 0 additions & 28 deletions cmd/config/show.go

This file was deleted.

1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/vektah/gqlparser/v2 v2.5.11
golang.org/x/crypto v0.21.0
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
gopkg.in/yaml.v2 v2.4.0
gorm.io/driver/mysql v1.5.6
gorm.io/gorm v1.25.9
)
Expand Down
52 changes: 0 additions & 52 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,58 +267,6 @@ func stringToLogLevelHookFunc() mapstructure.DecodeHookFunc {
}
}

func (x db) MarshalYAML() (interface{}, error) {
return db{base64.StdEncoding.EncodeToString([]byte(x.Dsn)), x.Debug}, nil
}

func (s session) MarshalYAML() (interface{}, error) {
return session{base64.StdEncoding.EncodeToString([]byte(s.Key)), s.ActiveFor}, nil
}

func (u urlLogin) MarshalYAML() (interface{}, error) {
return struct {
Key string
ExpiresIn time.Duration
ValidMethods []string `yaml:",flow"`
}{base64.StdEncoding.EncodeToString(u.Key), u.ExpiresIn, u.ValidMethods}, nil
}

func (k serverKind) MarshalYAML() (interface{}, error) {
if k == ServerKindHttp {
return "http", nil
}
if k == ServerKindFcgi {
return "fcgi", nil
}
return nil, fmt.Errorf("invalid kind of server")
}

func (c config) MarshalYAML() (interface{}, error) {
return struct {
RelyingParty struct {
Name string
ID string
Origins []string
}
DB db
Session session
UrlLogin urlLogin
BaseUrl string
Server struct {
Kind serverKind
HttpPort string
Limit struct {
RequestLimit int
WindowLength time.Duration
}
}
Features struct {
UserRegistration bool
}
Logger logger
}{c.RelyingParty, c.DB, c.Session, c.UrlLogin, c.BaseUrl.String(), c.Server, c.Features, c.Logger}, nil
}

func (c config) httpPort() string {
if c.Server.Kind != ServerKindHttp {
return ""
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"github.com/seb-schulz/onegate/cmd"
_ "github.com/seb-schulz/onegate/cmd/client"
_ "github.com/seb-schulz/onegate/cmd/config"
_ "github.com/seb-schulz/onegate/cmd/generate"
_ "github.com/seb-schulz/onegate/cmd/session"
_ "github.com/seb-schulz/onegate/cmd/user"
Expand Down

0 comments on commit 3801405

Please sign in to comment.