Skip to content

Commit

Permalink
update docker-compose after undoing complex changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-dzeda committed Dec 15, 2023
1 parent 19dd5e8 commit 360825b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 25 deletions.
6 changes: 2 additions & 4 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
dockerfile: Dockerfiles/Dockerfile.tests
args:
VERSION: latest
env_file:
- ./ssas/cfg/configs/local.env
environment:
- DB=postgresql://postgres:toor@db:5432
- DATABASE_URL=postgresql://postgres:toor@db:5432/bcda?sslmode=disable
Expand All @@ -17,13 +19,9 @@ services:
- SSAS_PUBLIC_PORT=:3003
- SSAS_ADMIN_PORT=:3004
- SSAS_HTTP_TO_HTTPS_PORT=:3005
- SSAS_READ_TIMEOUT=10
- SSAS_WRITE_TIMEOUT=20
- SSAS_IDLE_TIMEOUT=120
- SSAS_HASH_ITERATIONS=130000
- SSAS_HASH_KEY_LENGTH=64
- SSAS_HASH_SALT_SIZE=32
- SSAS_DEFAULT_SYSTEM_SCOPE=bcda-api
- SSAS_TOKEN_BLACKLIST_CACHE_CLEANUP_MINUTES=15
- SSAS_TOKEN_BLACKLIST_CACHE_TIMEOUT_MINUTES=1440
- SSAS_TOKEN_BLACKLIST_CACHE_REFRESH_MINUTES=5
Expand Down
8 changes: 2 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ services:
args:
VERSION: latest
image: bcda-ssas:latest
env_file:
- ./ssas/cfg/configs/local.env
environment:
- DATABASE_URL=postgresql://postgres:toor@db:5432/bcda?sslmode=disable
- DEBUG=true
- DEPLOYMENT_TARGET=local
- ATO_PUBLIC_KEY_FILE=../shared_files/ATO_public.pem
- ATO_PRIVATE_KEY_FILE=../shared_files/ATO_private.pem
- HTTP_ONLY=true
Expand All @@ -39,13 +39,9 @@ services:
- SSAS_ADMIN_PORT=:3004
- SSAS_PUBLIC_PORT=:3003
- SSAS_HTTP_TO_HTTPS_PORT=:3005
- SSAS_READ_TIMEOUT=10
- SSAS_WRITE_TIMEOUT=20
- SSAS_IDLE_TIMEOUT=120
- SSAS_HASH_ITERATIONS=130000
- SSAS_HASH_KEY_LENGTH=64
- SSAS_HASH_SALT_SIZE=32
- SSAS_DEFAULT_SYSTEM_SCOPE=bcda-api
- SSAS_TOKEN_BLACKLIST_CACHE_CLEANUP_MINUTES=15
- SSAS_TOKEN_BLACKLIST_CACHE_TIMEOUT_MINUTES=1440
- SSAS_TOKEN_BLACKLIST_CACHE_REFRESH_MINUTES=5
Expand Down
30 changes: 15 additions & 15 deletions ssas/systems.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ type ClientToken struct {
}

/*
SaveClientToken should be provided with a token label and token uuid, which will
be saved to the client tokens table and associated with the current system.
SaveClientToken should be provided with a token label and token uuid, which will
be saved to the client tokens table and associated with the current system.
*/
func (system *System) SaveClientToken(ctx context.Context, label string, groupXData string, expiration time.Time) (*ClientToken, string, error) {
rk, err := NewRootKey(ctx, system.ID, expiration)
Expand Down Expand Up @@ -167,8 +167,8 @@ type AuthRegData struct {
}

/*
SaveSecret should be provided with a secret hashed with ssas.NewHash(), which will
be saved to the secrets table and associated with the current system.
SaveSecret should be provided with a secret hashed with ssas.NewHash(), which will
be saved to the secrets table and associated with the current system.
*/
func (system *System) SaveSecret(ctx context.Context, hashedSecret string) error {
secret := Secret{
Expand All @@ -189,7 +189,7 @@ func (system *System) SaveSecret(ctx context.Context, hashedSecret string) error
}

/*
GetSecret will retrieve the hashed secret associated with the current system.
GetSecret will retrieve the hashed secret associated with the current system.
*/
func (system *System) GetSecret(ctx context.Context) (Secret, error) {
secret := Secret{}
Expand Down Expand Up @@ -220,7 +220,7 @@ func (system *System) SaveTokenTime(ctx context.Context) {
}

/*
RevokeSecret revokes a system's secret
RevokeSecret revokes a system's secret
*/
func (system *System) RevokeSecret(ctx context.Context, trackingID string) error {
revokeCredentialsEvent := Event{Op: "RevokeCredentials", TrackingID: trackingID, ClientID: system.ClientID}
Expand All @@ -246,7 +246,7 @@ func (system *System) RevokeSecret(ctx context.Context, trackingID string) error
}

/*
DeactivateSecrets soft deletes secrets associated with the system.
DeactivateSecrets soft deletes secrets associated with the system.
*/
func (system *System) deactivateSecrets(ctx context.Context) error {
err := Connection.WithContext(ctx).Where("system_id = ?", system.ID).Delete(&Secret{}).Error
Expand All @@ -257,7 +257,7 @@ func (system *System) deactivateSecrets(ctx context.Context) error {
}

/*
GetEncryptionKey retrieves the key associated with the current system.
GetEncryptionKey retrieves the key associated with the current system.
*/
func (system *System) GetEncryptionKey(ctx context.Context, trackingID string) (EncryptionKey, error) {
getKeyEvent := Event{Op: "GetEncryptionKey", TrackingID: trackingID, ClientID: system.ClientID}
Expand All @@ -275,7 +275,7 @@ func (system *System) GetEncryptionKey(ctx context.Context, trackingID string) (
}

/*
FindEncryptionKey retrieves the key by id associated with the current system.
FindEncryptionKey retrieves the key by id associated with the current system.
*/
func (system *System) FindEncryptionKey(ctx context.Context, trackingID string, keyId string) (EncryptionKey, error) {
findKeyEvent := Event{Op: "FindEncryptionKey", TrackingID: trackingID, ClientID: system.ClientID}
Expand All @@ -293,7 +293,7 @@ func (system *System) FindEncryptionKey(ctx context.Context, trackingID string,
}

/*
GetEncryptionKeys retrieves the keys associated with the current system.
GetEncryptionKeys retrieves the keys associated with the current system.
*/
func (system *System) GetEncryptionKeys(ctx context.Context, trackingID string) ([]EncryptionKey, error) {
getKeyEvent := Event{Op: "GetEncryptionKey", TrackingID: trackingID, ClientID: system.ClientID}
Expand All @@ -311,7 +311,7 @@ func (system *System) GetEncryptionKeys(ctx context.Context, trackingID string)
}

/*
DeleteEncryptionKey deletes the key associated with the current system.
DeleteEncryptionKey deletes the key associated with the current system.
*/
func (system *System) DeleteEncryptionKey(ctx context.Context, trackingID string, keyID string) error {
deleteKeyEvent := Event{Op: "DeleteEncryptionKey", TrackingID: trackingID, ClientID: system.ClientID}
Expand All @@ -334,8 +334,8 @@ func (system *System) DeleteEncryptionKey(ctx context.Context, trackingID string
}

/*
SavePublicKey should be provided with a public key in PEM format, which will be saved
to the encryption_keys table and associated with the current system.
SavePublicKey should be provided with a public key in PEM format, which will be saved
to the encryption_keys table and associated with the current system.
*/
func (system *System) SavePublicKey(publicKey io.Reader, signature string) (*EncryptionKey, error) {
return system.SavePublicKeyDB(publicKey, signature, true, Connection)
Expand Down Expand Up @@ -400,8 +400,8 @@ type Credentials struct {
}

/*
RegisterSystem will save a new system and public key after verifying provided details for validity. It returns
a ssas.Credentials struct including the generated clientID and secret.
RegisterSystem will save a new system and public key after verifying provided details for validity. It returns
a ssas.Credentials struct including the generated clientID and secret.
*/
func RegisterSystem(ctx context.Context, clientName string, groupID string, scope string, publicKeyPEM string, ips []string, trackingID string) (Credentials, error) {
systemInput := SystemInput{
Expand Down

0 comments on commit 360825b

Please sign in to comment.