Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/auth grpc #112

Merged
merged 13 commits into from
Nov 6, 2020
26 changes: 17 additions & 9 deletions deployments/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ services:
rabbit:
container_name: rabbit
image: rabbitmq:3-management
network_mode: "host"
ports:
- "5672:5672"
- "15672:15672"
postgresql:
container_name: postgresql
network_mode: "host"
image: postgres:12
ports:
- "5432:5432"
Expand All @@ -30,10 +32,11 @@ services:
- "rabbit"
restart: always
container_name: horusec-messages
network_mode: "host"
ports:
- "8004:8004"
environment:
HORUSEC_BROKER_HOST: rabbit
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
HORUSEC_BROKER_USERNAME: "guest"
HORUSEC_BROKER_PASSWORD: "guest"
Expand All @@ -52,18 +55,19 @@ services:
- postgresql
restart: always
container_name: horusec-account
network_mode: "host"
ports:
- "8003:8003"
environment:
HORUSEC_ACCOUNT_DISABLE_EMAIL_SERVICE: "true"
HORUSEC_BROKER_HOST: rabbit
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
HORUSEC_BROKER_USERNAME: "guest"
HORUSEC_BROKER_PASSWORD: "guest"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_AUTH_URL: "http://horusec-auth:8006"
HORUSEC_AUTH_URL: "127.0.0.1:8007"
horusec-auth:
build:
context: ../
Expand All @@ -72,10 +76,12 @@ services:
- postgresql
restart: always
container_name: horusec-auth
network_mode: "host"
ports:
- "8006:8006"
- "8007:8007"
environment:
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_KEYCLOAK_BASE_PATH: ${HORUSEC_KEYCLOAK_BASE_PATH}
Expand All @@ -93,12 +99,13 @@ services:
- postgresql
restart: always
container_name: horusec-analytic
network_mode: "host"
ports:
- "8005:8005"
environment:
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_AUTH_URL: "http://horusec-auth:8006"
HORUSEC_AUTH_URL: "127.0.0.1:8007"
horusec-api:
build:
context: ../
Expand All @@ -108,13 +115,14 @@ services:
- postgresql
restart: always
container_name: horusec-api
network_mode: "host"
ports:
- "8000:8000"
environment:
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_AUTH_URL: "http://horusec-auth:8006"
HORUSEC_AUTH_URL: "127.0.0.1:8007"
horusec-manager:
build:
context: ../
Expand Down
26 changes: 17 additions & 9 deletions deployments/docker-compose.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ services:
rabbit:
container_name: rabbit
image: rabbitmq:3-management
network_mode: "host"
ports:
- "5672:5672"
- "15672:15672"
postgresql:
container_name: postgresql
network_mode: "host"
image: postgres:12
ports:
- "5432:5432"
Expand All @@ -30,10 +32,11 @@ services:
- "rabbit"
restart: always
container_name: horusec-messages
network_mode: "host"
ports:
- "8004:8004"
environment:
HORUSEC_BROKER_HOST: rabbit
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
HORUSEC_BROKER_USERNAME: "guest"
HORUSEC_BROKER_PASSWORD: "guest"
Expand All @@ -52,18 +55,19 @@ services:
- postgresql
restart: always
container_name: horusec-account
network_mode: "host"
ports:
- "8003:8003"
environment:
HORUSEC_ACCOUNT_DISABLE_EMAIL_SERVICE: "true"
HORUSEC_BROKER_HOST: rabbit
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
HORUSEC_BROKER_USERNAME: "guest"
HORUSEC_BROKER_PASSWORD: "guest"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_AUTH_URL: "http://horusec-auth:8006"
HORUSEC_AUTH_URL: "127.0.0.1:8007"
horusec-auth:
build:
context: ../
Expand All @@ -72,10 +76,12 @@ services:
- postgresql
restart: always
container_name: horusec-auth
network_mode: "host"
ports:
- "8006:8006"
- "8007:8007"
environment:
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_KEYCLOAK_BASE_PATH: ${HORUSEC_KEYCLOAK_BASE_PATH}
Expand All @@ -93,12 +99,13 @@ services:
- postgresql
restart: always
container_name: horusec-analytic
network_mode: "host"
ports:
- "8005:8005"
environment:
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_AUTH_URL: "http://horusec-auth:8006"
HORUSEC_AUTH_URL: "127.0.0.1:8007"
horusec-api:
build:
context: ../
Expand All @@ -108,13 +115,14 @@ services:
- postgresql
restart: always
container_name: horusec-api
network_mode: "host"
ports:
- "8000:8000"
environment:
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_AUTH_URL: "http://horusec-auth:8006"
HORUSEC_AUTH_URL: "127.0.0.1:8007"
horusec-manager:
build:
context: ../
Expand Down
26 changes: 17 additions & 9 deletions deployments/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ services:
rabbit:
container_name: rabbit
image: rabbitmq:3-management
network_mode: "host"
ports:
- "5672:5672"
- "15672:15672"
postgresql:
container_name: postgresql
image: postgres:12
network_mode: "host"
ports:
- "5432:5432"
environment:
Expand All @@ -26,10 +28,11 @@ services:
image: horuszup/horusec-messages:latest
restart: always
container_name: horusec-messages
network_mode: "host"
ports:
- "8004:8004"
environment:
HORUSEC_BROKER_HOST: rabbit
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
HORUSEC_BROKER_USERNAME: "guest"
HORUSEC_BROKER_PASSWORD: "guest"
Expand All @@ -45,10 +48,12 @@ services:
# - postgresql
# restart: always
# container_name: horusec-auth
# network_mode: "host"
# ports:
# - "8006:8006"
# - "8007:8007"
# environment:
# HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
# HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
# HORUSEC_DATABASE_SQL_DIALECT: "postgres"
# HORUSEC_JWT_SECRET_KEY: "horusec-secret"
# HORUSEC_KEYCLOAK_BASE_PATH: ${HORUSEC_KEYCLOAK_BASE_PATH}
Expand All @@ -65,44 +70,47 @@ services:
- postgresql
restart: always
container_name: horusec-account
network_mode: "host"
ports:
- "8003:8003"
environment:
HORUSEC_ACCOUNT_DISABLE_EMAIL_SERVICE: "true"
HORUSEC_BROKER_HOST: rabbit
HORUSEC_BROKER_HOST: "127.0.0.1"
HORUSEC_BROKER_PORT: "5672"
HORUSEC_BROKER_USERNAME: "guest"
HORUSEC_BROKER_PASSWORD: "guest"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_AUTH_URL: "http://horusec-auth:8006"
HORUSEC_AUTH_URL: "127.0.0.1:8007"
horusec-analytic:
image: horuszup/horusec-analytic:latest
depends_on:
- postgresql
restart: always
container_name: horusec-analytic
network_mode: "host"
ports:
- "8005:8005"
environment:
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_AUTH_URL: "http://horusec-auth:8006"
HORUSEC_AUTH_URL: "127.0.0.1:8007"
horusec-api:
image: horuszup/horusec-api:latest
depends_on:
- "rabbit"
- postgresql
restart: always
container_name: horusec-api
network_mode: "host"
ports:
- "8000:8000"
environment:
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@postgresql:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_URI: "postgresql://root:root@127.0.0.1:5432/horusec_db?sslmode=disable"
HORUSEC_DATABASE_SQL_DIALECT: "postgres"
HORUSEC_JWT_SECRET_KEY: "horusec-secret"
HORUSEC_AUTH_URL: "http://horusec-auth:8006"
HORUSEC_AUTH_URL: "127.0.0.1:8007"
horusec-manager:
image: horuszup/horusec-manager:latest
restart: always
Expand Down
6 changes: 5 additions & 1 deletion development-kit/pkg/enums/errors/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ import "errors"
var ErrorInvalidAuthType = errors.New("{AUTH} invalid auth type, should be ldap, keycloak or horus")
var ErrorTokenCanNotBeEmpty = errors.New("{AUTH} token can not be empty in authorization header")

const ErrorAuthTypeNotActive = "{AUTH} this auth type it is no active, should be %s"
const (
ErrorAuthTypeNotActive = "{AUTH} this auth type it is no active, should be %s"
ErrorFailedToVerifyIsAuthorized = "{AUTH} failed to verify is authorized request"
ErrorFailedToGetAccountID = "{AUTH} failed to get account id from token"
)
Loading