Refactored services, rest and rdbms
Added tests Added ac to routes and functions Proxy processer and auth servicer Added options and extensive logging Fixed calls to rbac in service, added default http handler on gateway root
This commit is contained in:
Generated
+47
@@ -0,0 +1,47 @@
|
||||
package options
|
||||
|
||||
// This file is auto-generated.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
//
|
||||
// Definitions file that controls how this file is generated:
|
||||
// pkg/options/apigw.yaml
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type (
|
||||
ApigwOpt struct {
|
||||
Enabled bool `env:"APIGW_ENABLED"`
|
||||
LogEnabled bool `env:"APIGW_LOG_ENABLED"`
|
||||
ProxyEnableDebugLog bool `env:"APIGW_PROXY_ENABLE_DEBUG_LOG"`
|
||||
ProxyFollowRedirects bool `env:"APIGW_PROXY_FOLLOW_REDIRECTS"`
|
||||
ProxyOutboundTimeout time.Duration `env:"APIGW_PROXY_OUTBOUND_TIMEOUT"`
|
||||
}
|
||||
)
|
||||
|
||||
// Apigw initializes and returns a ApigwOpt with default values
|
||||
func Apigw() (o *ApigwOpt) {
|
||||
o = &ApigwOpt{
|
||||
Enabled: true,
|
||||
LogEnabled: false,
|
||||
ProxyEnableDebugLog: false,
|
||||
ProxyFollowRedirects: true,
|
||||
ProxyOutboundTimeout: time.Second * 30,
|
||||
}
|
||||
|
||||
fill(o)
|
||||
|
||||
// Function that allows access to custom logic inside the parent function.
|
||||
// The custom logic in the other file should be like:
|
||||
// func (o *Apigw) Defaults() {...}
|
||||
func(o interface{}) {
|
||||
if def, ok := o.(interface{ Defaults() }); ok {
|
||||
def.Defaults()
|
||||
}
|
||||
}(o)
|
||||
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
docs:
|
||||
title: API Gateway
|
||||
|
||||
imports:
|
||||
- time
|
||||
|
||||
props:
|
||||
- name: Enabled
|
||||
type: bool
|
||||
default: true
|
||||
description: |-
|
||||
Enable API Gateway
|
||||
|
||||
- name: logEnabled
|
||||
type: bool
|
||||
default: false
|
||||
description: |-
|
||||
Enable extra logging
|
||||
|
||||
- name: proxyEnableDebugLog
|
||||
type: bool
|
||||
default: false
|
||||
description: |-
|
||||
Enable full debug log on requests / responses - warning, includes sensitive data
|
||||
|
||||
- name: proxyFollowRedirects
|
||||
type: bool
|
||||
default: true
|
||||
description: |-
|
||||
Follow redirects on proxy requests
|
||||
|
||||
- name: proxyOutboundTimeout
|
||||
type: time.Duration
|
||||
default: time.Second * 30
|
||||
description: |-
|
||||
Outbound request timeout
|
||||
|
||||
Reference in New Issue
Block a user