Skip to content

Commit

Permalink
Fix public client, update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
giftkugel committed Sep 5, 2024
1 parent 620eca4 commit 7c0510f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
5 changes: 0 additions & 5 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,6 @@ func (config *Config) Validate() error {
return errors.New(invalidClient)
}

if len(client.ClientSecret) != 128 {
invalidClient := fmt.Sprintf("client configuration invalid for client %d with id %s, missing client secret %v", clientIndex, client.Id, client)
return errors.New(invalidClient)
}

if len(client.Redirects) == 0 {
invalidClient := fmt.Sprintf("client configuration invalid, for client %d with id %s, missing redirects, %v", clientIndex, client.Id, client)
return errors.New(invalidClient)
Expand Down
32 changes: 0 additions & 32 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,38 +651,6 @@ func Test_UserWithoutUsername(t *testing.T) {
}
}

func Test_ClientWithoutSecret(t *testing.T) {
configLoader := NewConfigLoader(func(filename string) ([]byte, error) {
return make([]byte, 10), nil
}, func(in []byte, out interface{}) (err error) {
origin := out.(*Config)
*origin = Config{
Server: Server{
Addr: ":8080",
},
Users: []User{
{
Username: "foo",
Password: "d82c4eb5261cb9c8aa9855edd67d1bd10482f41529858d925094d173fa662aa91ff39bc5b188615273484021dfb16fd8284cf684ccf0fc795be3aa2fc1e6c181",
},
},
Clients: []Client{
{
Id: "foo",
Redirects: []string{"https://example.com/callback"},
},
},
}
return nil
})

err := configLoader.LoadConfig("foo.txt", true)

if err == nil {
t.Error("expected error when loading config")
}
}

func Test_ClientWithoutId(t *testing.T) {
configLoader := NewConfigLoader(func(filename string) ([]byte, error) {
return make([]byte, 10), nil
Expand Down

0 comments on commit 7c0510f

Please sign in to comment.