RISKEN Gateway
RISKEN
is a monitoring tool for your cloud platforms, web-site, source-code...
RISKEN Gateway
is a API-Gateway layer for RISKEN backend APIs. Gateway is responsible for authentication & authorization control and request routing.
Please check RISKEN Documentation.
Installation
Requirements
This module requires the following modules:
Install packages
This module is developed in the Go language
, please run the following command after installing the Go
.
$ make install
Building
Build the containers on your machine with the following command
$ make build
Running Apps
Deploy the pre-built containers to the Kubernetes environment on your local machine.
- Follow the documentation to download the Kubernetes manifest sample.
- Fix the Kubernetes object specs of the manifest file as follows and deploy it.
k8s-sample/overlays/local/gateway.yaml
service |
spec |
before (public images) |
after (pre-build images on your machine) |
gateway |
spec.template.spec.containers.image |
public.ecr.aws/risken/gateway/gateway:latest |
gateway/gateway:latest |
Implements services
After change proto files in other repository, you must apply it to this repository. And you can do most of these easily.
Case: only proxy HTTP to gRPC
Generate boilerplate code from proto files
make generate-service
Add routing code to router.go
func newRouter(svc *gatewayService) *chi.Mux {
// ...
r.Get("<routing path>", svc.<generated method>) // append
// ...
}
Case: others, need most complex process
Add exclude configuration to hack/protoc-gen-service.yml
excludes:
# Ignore
## core
- AlertService.AnalyzeAlertAll
- FindingService.BatchListFinding
- FindingService.PutFindingBatch
- <ServiceName>.<MethodName> # append
Implements request handler and add it to router
Info on reporting bugs, getting help, finding roadmaps,
and more can be found in the RISKEN Community.
License
MIT.