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

Commit

Permalink
Remove default config (#478)
Browse files Browse the repository at this point in the history
Signed-off-by: Yee Hing Tong <wild-endeavor@users.noreply.github.com>
  • Loading branch information
wild-endeavor authored Sep 27, 2022
1 parent f0e4c89 commit 281172e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2019 Lyft, Inc.
Copyright 2022 flyte.org

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion auth/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var (
},
"flytepropeller": {
ID: "flytepropeller",
Secret: []byte(`$2a$06$pxs1AkG81Kvrhpml1QiLSOQaTk9eePrU/7Yab9y07h3x0TglbaoT6`), // = "foobar"
Secret: []byte(`$2a$06$d6PQn2QAFU3cL5V8MDkeuuk63xubqUxNxjtfPw.Fc9MgV6vpmyOIy`), // Change this.
RedirectURIs: []string{"http://localhost:3846/callback"},
ResponseTypes: []string{"token"},
GrantTypes: []string{"refresh_token", "client_credentials"},
Expand Down
12 changes: 11 additions & 1 deletion auth/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/flyteorg/flytestdlib/config/viper"

"github.com/ghodss/yaml"

"github.com/stretchr/testify/assert"

"github.com/ory/fosite"
Expand Down Expand Up @@ -49,3 +48,14 @@ func TestParseClientSecretConfig(t *testing.T) {
assert.NoError(t, accessor.UpdateConfig(context.Background()))
assert.Equal(t, "my-client", GetConfig().AppAuth.SelfAuthServer.StaticClients["my-client"].ID)
}

func TestDefaultConfig(t *testing.T) {
assert.Equal(t, len(DefaultConfig.AppAuth.SelfAuthServer.StaticClients), 3)
assert.Equal(t, DefaultConfig.AppAuth.SelfAuthServer.StaticClients["flyte-cli"].ID, "flyte-cli")
}

func TestCompare(t *testing.T) {
hasher := &fosite.BCrypt{WorkFactor: 6}
err := hasher.Compare(context.Background(), DefaultConfig.AppAuth.SelfAuthServer.StaticClients["flytepropeller"].Secret, []byte("foobar"))
assert.Error(t, err)
}

0 comments on commit 281172e

Please # to comment.