Skip to content

Commit

Permalink
refactor: remove unused variable and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Luthfi Fahlevi committed Nov 15, 2024
1 parent a5ac246 commit 38ce71b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
6 changes: 2 additions & 4 deletions docs/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ service:
host: localhost #required
port: 8080 #required
identity:
headerkey_uuid: Compass-User-UUID #required
headerkey_email: Compass-User-Email #optional
provider_default_name: shield #optional
grpc:
Expand All @@ -76,7 +75,6 @@ DB_PASSWORD=compass_password
DB_SSLMODE=disable
SERVICE_HOST=localhost
SERVICE_PORT=8080
SERVICE_IDENTITY_HEADERKEY_UUID=Compass-User-UUID
SERVICE_IDENTITY_HEADERKEY_EMAIL=Compass-User-Email
SERVICE_IDENTITY_PROVIDER_DEFAULT_NAME=shield
SERVICE_GRPC_PORT=8081
Expand Down Expand Up @@ -262,8 +260,8 @@ Add client configurations in the same `~/compass.yaml` file in root of current d
```yml
client:
host: localhost:8081
serverheaderkey_uuid: Compass-User-UUID
serverheadervalue_uuid: [email protected]
serverheaderkey_email: Compass-User-Email
serverheadervalue_email: [email protected]
```
#### Required Header/Metadata in API
Expand Down
4 changes: 0 additions & 4 deletions docs/docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ Compass's required variables to start using it.
* Example value: `disable`
* Type: `optional`
* PostgreSQL DB SSL mode to connect.
### `IDENTITY_UUID_HEADER`
* Example value: `Compass-User-UUID`
* Type: `required`
* Header key to accept Compass User UUID. See [User](../concepts/user.md) for more information about the usage.
### `IDENTITY_EMAIL_HEADER`
* Example value: `Compass-User-Email`
* Type: `optional`
Expand Down
4 changes: 0 additions & 4 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ func (cfg Config) grpcAddr() string { return fmt.Sprintf("%s:%d", cfg.Host, cfg.

type IdentityConfig struct {
// User Identity
HeaderKeyUUID string `yaml:"headerkey_uuid" mapstructure:"headerkey_uuid" default:"Compass-User-UUID"`
HeaderValueUUID string `yaml:"headervalue_uuid" mapstructure:"headervalue_uuid" default:"[email protected]"`
HeaderKeyEmail string `yaml:"headerkey_email" mapstructure:"headerkey_email" default:"Compass-User-Email"`
HeaderValueEmail string `yaml:"headervalue_email" mapstructure:"headervalue_email" default:"[email protected]"`
ProviderDefaultName string `yaml:"provider_default_name" mapstructure:"provider_default_name" default:""`
Expand Down Expand Up @@ -178,8 +176,6 @@ func makeHeaderMatcher(c Config) func(key string) (string, bool) {
switch strings.ToLower(key) {
case strings.ToLower(c.Identity.HeaderKeyEmail):
return key, true
case strings.ToLower(c.Identity.HeaderKeyUUID):
return key, true
default:
return runtime.DefaultHeaderMatcher(key)
}
Expand Down
1 change: 0 additions & 1 deletion test/e2e_test/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (

var (
SERVER_HOST = "http://localhost:8080"
IDENTITY_HEADER_KEY_UUID = "Compass-User-UUID"
IDENTITY_HEADER_KEY_EMAIL = "Compass-User-Email"
)

Expand Down

0 comments on commit 38ce71b

Please sign in to comment.