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

refactor: rename hub-auth to auth and hub-router to mediator #484

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions hub-auth/Makefile → auth/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ OS = $(shell uname -s | tr '[:upper:]' '[:lower:]')
ARCH = $(shell uname -m | sed 's/x86_64/amd64/')

#IMAGES
HUB_AUTH_IMG ?= ghcr.io/trustbloc-cicd/auth:0.1.9-snapshot-5a7b16c
AUTH_IMG ?= ghcr.io/trustbloc-cicd/auth:0.1.9-snapshot-5a7b16c

# do not modify
KUSTOMIZE_DIR = kustomize/hub-auth
KUSTOMIZE_DIR = kustomize/auth
KEYS_OUTPUT_DIR = ${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV}/keys
CERTS_OUTPUT_DIR = ${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV}/certs
PREFIX ?=
Expand Down Expand Up @@ -64,7 +64,7 @@ generate-test-keys: clean-keys
docker.io/frapsoft/openssl:latest

.PHONY: deploy
deploy: prechecks kustomize kubectl set-images set-labels deploy-hub-auth
deploy: prechecks kustomize kubectl set-images set-labels deploy-auth

.PHONY: prechecks
prechecks:
Expand All @@ -75,30 +75,30 @@ endif

.PHONY: set-labels
set-labels: kustomize
@pushd ${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV}/hub-auth &&\
@pushd ${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV}/auth &&\
${KUSTOMIZE} edit set label ${COMMON_LABELS} &&\
popd

.PHONY: set-images
set-images: kustomize
@pushd ${KUSTOMIZE_DIR}/base &&\
${KUSTOMIZE} edit set image hub-auth=${HUB_AUTH_IMG} &&\
${KUSTOMIZE} edit set image auth=${AUTH_IMG} &&\
popd

.PHONY: deploy-hub-auth
deploy-hub-auth: prechecks kustomize kubectl
@docker pull $(HUB_AUTH_IMG)
@minikube image load $(HUB_AUTH_IMG)
.PHONY: deploy-auth
deploy-auth: prechecks kustomize kubectl
@docker pull $(AUTH_IMG)
@minikube image load $(AUTH_IMG)
$(KUSTOMIZE) build ${KUSTOMIZE_BUILD_OPTS} \
${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV}/hub-auth | $(KUBECTL) apply -f -
${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV}/auth | $(KUBECTL) apply -f -

.PHONY: undeploy
undeploy: prechecks kustomize kubectl set-images set-labels undeploy-hub-auth
undeploy: prechecks kustomize kubectl set-images set-labels undeploy-auth

.PHONY: undeploy-hub-auth
undeploy-hub-auth: prechecks kustomize kubectl
.PHONY: undeploy-auth
undeploy-auth: prechecks kustomize kubectl
$(KUSTOMIZE) build ${KUSTOMIZE_BUILD_OPTS} \
${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV}/hub-auth | $(KUBECTL) delete -f -
${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV}/auth | $(KUBECTL) delete -f -

.PHONY: kustomize
kustomize:
Expand Down
6 changes: 3 additions & 3 deletions hub-auth/README.md → auth/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [HUB-AUTH](https://github.com/trustbloc/hub-auth) k8s deployment #
# [Auth](https://github.com/trustbloc/auth) k8s deployment #


## pre-requisits
Expand All @@ -17,9 +17,9 @@
## options and features
* By default dns domain is `local.trustboc.dev`. To run with different domain (See next), run with: `make DOMAIN=ali.trustbloc.dev`
* Will create an Ingress for external access. When running with unregistered dns domains, create records (/etc/hosts) for:
- `hub-auth.DOMAIN`
- `auth.DOMAIN`
* if running `podman` pass `CONTAINER_CMD=podman` as option to make
* Running with none self-signed certificates: place certs into kustomize/hub-auth/overlays/sandbox/certs, then run with: `make setup-no-certs`.
* Running with none self-signed certificates: place certs into kustomize/auth/overlays/sandbox/certs, then run with: `make setup-no-certs`.
>files:
- ca.crt
- tls.crt
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ AUTH_REST_DATABASE_TYPE=mem
AUTH_REST_DATABASE_PREFIX=authrest_
AUTH_REST_OIDC_CALLBACK=http://
AUTH_REST_HYDRA_URL=http://
AUTH_REST_OIDC_PROVIDERS_CONFIG=/etc/hub-auth/config/providers.yml
AUTH_REST_OIDC_PROVIDERS_CONFIG=/etc/auth/config/providers.yml
AUTH_REST_SDS_DOCS_URL=http://
AUTH_REST_SDS_OPSKEYS_URL=http://
AUTH_REST_KEYSERVER_AUTH_URL=http://
AUTH_REST_KEYSERVER_OPS_URL=http://
AUTH_REST_COOKIE_AUTH_KEY=/etc/hub-auth/keys/auth.key
AUTH_REST_COOKIE_ENC_KEY=/etc/hub-auth/keys/enc.key
AUTH_REST_COOKIE_AUTH_KEY=/etc/auth/keys/auth.key
AUTH_REST_COOKIE_ENC_KEY=/etc/auth/keys/enc.key
AUTH_REST_STATIC_IMAGES=/etc/static/images
AUTH_REST_EXTERNAL_URL=https://hub-auth.||DOMAIN||
AUTH_REST_EXTERNAL_URL=https://auth.||DOMAIN||
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ spec:
name: auth-env
- secretRef:
name: auth-env-secret
image: hub-auth:latest
image: auth:latest
args: ["start"]
ports:
- containerPort: 8081
protocol: TCP
name: http-port
volumeMounts:
- name: keys
mountPath: /etc/hub-auth/keys
mountPath: /etc/auth/keys
readOnly: true
- name: config
mountPath: /etc/hub-auth/config
mountPath: /etc/auth/config
readOnly: true
- name: auth-static-config
mountPath: /etc/static/config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ resources:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: hub-auth
- name: auth
newName: ghcr.io/trustbloc-cicd/auth
newTag: 0.1.9-snapshot-5a7b16c
19 changes: 19 additions & 0 deletions auth/kustomize/auth/overlays/common/auth-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Copyright SecureKey Technologies Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

providers:
mockbank:
url: https://hydra.||DOMAIN||/
clientID: auth
clientSecret: auth-secret
name: Demo OIDC
signUpIconURL:
en: https://auth.||DOMAIN||/static/images/en--demo-sign-up-button.svg
fr: https://auth.||DOMAIN||/static/images/fr--demo-sign-up-button.svg
signInIconURL:
en: https://auth.||DOMAIN||/static/images/en--demo-sign-in-button.svg
fr: https://auth.||DOMAIN||/static/images/fr--demo-sign-in-button.svg
order: 1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

AUTH_REST_DATABASE_TYPE=mongodb
AUTH_REST_OIDC_CALLBACK=https://hub-auth.||DOMAIN||/oauth2/callback
AUTH_REST_OIDC_CALLBACK=https://auth.||DOMAIN||/oauth2/callback
AUTH_REST_HYDRA_URL=https://hub-hydra-admin.||DOMAIN||
AUTH_REST_SDS_DOCS_URL=https://TODO.docs.sds.org/
AUTH_REST_SDS_OPSKEYS_URL=https://TODO.keys.sds.org/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: hub-

commonLabels:
component: hub-auth
component: auth
group: core
project: trustbloc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
volumes:
- name: ca-cert
configMap:
name: hub-auth-ca-cert
name: auth-ca-cert
containers:
- name: auth
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hub-auth
name: auth
labels:
app: auth
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
commonLabels:
component: hub-auth
component: auth
group: core
instance: local
project: trustbloc
Expand All @@ -26,30 +26,30 @@ secretGenerator:
- files:
- ../certs/tls.crt
- ../certs/tls.key
name: hub-auth-wildcard-cert
name: auth-wildcard-cert
type: kubernetes.io/tls
- behavior: replace
files:
- ../keys/auth.key
- ../keys/enc.key
name: hub-auth-keys
name: auth-keys

configMapGenerator:
- behavior: merge
envs:
- auth.env
name: hub-auth-env
name: auth-env
- files:
- ../certs/ca.crt
name: hub-auth-ca-cert
name: auth-ca-cert

replacements:
- path: replacements.yml
source: null
targets: null
- source:
kind: Secret
name: hub-auth-wildcard-cert
name: auth-wildcard-cert
version: v1
targets:
- fieldPaths:
Expand All @@ -66,7 +66,7 @@ replacements:
- spec.tls.0.secretName
select:
kind: Ingress
name: hub-auth
name: auth

resources:
- ../../common
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source:
kind: Service
name: router
name: auth
version: v1
targets:
- fieldPaths:
Expand All @@ -10,9 +10,9 @@ targets:
delimiter: .
select:
kind: Ingress
name: router
name: auth
- fieldPaths:
- spec.rules.0.http.paths.0.backend.service.name
select:
kind: Ingress
name: router
name: auth
2 changes: 1 addition & 1 deletion edv/kustomize/edv/overlays/common/edv/config.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ EDV_DID_DOMAIN=||BLOC_DOMAIN||
EDV_DATABASE_TIMEOUT=60
EDV_TLS_SYSTEMCERTPOOL=true
EDV_AUTH_TYPE=GNAP,ZCAP
EDV_AUTH_SERVER_URL=https://hub-auth.||DOMAIN||
EDV_AUTH_SERVER_URL=https://auth.||DOMAIN||
19 changes: 0 additions & 19 deletions hub-auth/kustomize/hub-auth/overlays/common/auth-config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion kms/kustomize/kms/overlays/common/vault-kms/kms/config.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ KMS_TLS_SYSTEMCERTPOOL=true
KMS_BASE_URL=https://vault-kms.||DOMAIN||
KMS_DID_DOMAIN=||BLOC_DOMAIN||
KMS_CACHE_ENABLE=true
KMS_AUTH_SERVER_URL=https://hub-auth.||DOMAIN||
KMS_AUTH_SERVER_URL=https://auth.||DOMAIN||
16 changes: 8 additions & 8 deletions hub-router/Makefile → mediator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ARCH = $(shell uname -m | sed 's/x86_64/amd64/')
MEDIATOR_IMG ?= ghcr.io/trustbloc-cicd/mediator:0.1.9-snapshot-12ee465

# do not modify
KUSTOMIZE_DIR = kustomize/hub-router
KUSTOMIZE_DIR = kustomize/mediator
CERTS_OUTPUT_DIR = ${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV}/certs
PREFIX ?=
KUSTOMIZE_BUILD_OPTS ?= --load-restrictor LoadRestrictionsNone --enable-alpha-plugins
Expand Down Expand Up @@ -59,7 +59,7 @@ generate-test-certs: clean-certs
@cd ${CERTS_OUTPUT_DIR} && ln -fs ${DOMAIN}.crt tls.crt

.PHONY: deploy
deploy: prechecks kustomize kubectl set-images set-labels deploy-hub-router
deploy: prechecks kustomize kubectl set-images set-labels deploy-mediator

.PHONY: prechecks
prechecks:
Expand All @@ -77,21 +77,21 @@ set-labels: kustomize
.PHONY: set-images
set-images: kustomize
@pushd ${KUSTOMIZE_DIR}/base &&\
${KUSTOMIZE} edit set image hub-router=${MEDIATOR_IMG} &&\
${KUSTOMIZE} edit set image mediator=${MEDIATOR_IMG} &&\
popd

.PHONY: deploy-hub-router
deploy-hub-router: prechecks kustomize kubectl
.PHONY: deploy-mediator
deploy-mediator: prechecks kustomize kubectl
@docker pull $(MEDIATOR_IMG)
@minikube image load $(MEDIATOR_IMG)
$(KUSTOMIZE) build ${KUSTOMIZE_BUILD_OPTS} \
${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV} | $(KUBECTL) apply -f -

.PHONY: undeploy
undeploy: prechecks kustomize kubectl set-images set-labels undeploy-hub-router
undeploy: prechecks kustomize kubectl set-images set-labels undeploy-mediator

.PHONY: undeploy-hub-router
undeploy-hub-router: prechecks kustomize kubectl
.PHONY: undeploy-mediator
undeploy-mediator: prechecks kustomize kubectl
$(KUSTOMIZE) build ${KUSTOMIZE_BUILD_OPTS} \
${KUSTOMIZE_DIR}/overlays/${DEPLOYMENT_ENV} | $(KUBECTL) delete -f -

Expand Down
12 changes: 6 additions & 6 deletions hub-router/README.md → mediator/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [Hub Router](https://github.com/trustbloc/hub-router) k8s deployment #
# [Mediator](https://github.com/trustbloc/mediator) k8s deployment #


## pre-requisits
Expand All @@ -8,19 +8,19 @@

## Quick Run
* `make all`
* `make deploy-hub-router`
* `make deploy-mediator`

## Cleanup
* `make undeploy-hub-router`
* `make undeploy-mediator`
* `make clean`

## options and features
* By default dns domain is `local.trustboc.dev`. To run with different domain (See next), run with: `make DOMAIN=ali.trustbloc.dev`
* By default Bloc domain is `orb-1.trustboc.dev`. To run with different domain (See next), run with: `make BLOC_DOMAIN=orb-1.ali.trustbloc.dev`
* Will create an Ingress for external access. When running with unregistered dns domains, create records (/etc/hosts) for:
- `router.DOMAIN`
- `router-ws.DOMAIN`
- `router-api.DOMAIN`
- `mediator.DOMAIN`
- `mediator-ws.DOMAIN`
- `mediator-api.DOMAIN`
* if running `podman` pass `CONTAINER_CMD=podman` as option to make
* Running with none self-signed certificates: place certs into kustomize/wallet/overlays/sandbox/certs, then run with: `make setup-no-certs`.
>files:
Expand Down
Loading