2020-02-12 13:53:27 -05:00
|
|
|
package globals
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
2020-08-24 13:22:10 -04:00
|
|
|
// NOTE: Globals, in the traditional sense, are bad. But there are some
|
|
|
|
|
// situations where we want a value that is constant per invocation but
|
|
|
|
|
// invocation may be in various places, such as a test or via CLI, and placing
|
|
|
|
|
// such a value in any given package leads to import issues. So think of this
|
|
|
|
|
// package as "freeing us from circular dependency hell". These values should
|
|
|
|
|
// only ever be set at startup, but simply available to reference from anywhere.
|
2020-02-12 13:53:27 -05:00
|
|
|
|
2020-08-25 00:20:50 -04:00
|
|
|
const (
|
2020-09-08 23:57:26 -04:00
|
|
|
TcpProxyV1 = "boundary-tcp-proxy-v1"
|
|
|
|
|
ServiceTokenV1 = "s1"
|
2020-08-25 00:20:50 -04:00
|
|
|
)
|
|
|
|
|
|
2021-01-07 10:02:32 -05:00
|
|
|
type (
|
2021-05-04 19:57:35 -05:00
|
|
|
ContextMaxRequestSizeType struct{}
|
|
|
|
|
ContextOriginalRequestPathType struct{}
|
2021-01-07 10:02:32 -05:00
|
|
|
)
|
2020-07-14 14:32:47 -07:00
|
|
|
|
2020-02-12 13:53:27 -05:00
|
|
|
var (
|
|
|
|
|
// DefaultMaxRequestDuration is the amount of time we'll wait for a request
|
|
|
|
|
DefaultMaxRequestDuration = 90 * time.Second
|
|
|
|
|
|
|
|
|
|
// DefaultMaxRequestSize is the maximum size of a request we allow by default
|
|
|
|
|
DefaultMaxRequestSize = int64(1024 * 1024)
|
2020-08-20 13:34:03 -04:00
|
|
|
|
|
|
|
|
// ContextMaxRequestSizeTypeKey is a value to keep linters from complaining
|
|
|
|
|
// about clashing string identifiers
|
|
|
|
|
ContextMaxRequestSizeTypeKey ContextMaxRequestSizeType
|
|
|
|
|
|
|
|
|
|
// ContextOriginalRequestPathTypeKey is a value to keep linters from complaining
|
|
|
|
|
// about clashing string identifiers
|
|
|
|
|
ContextOriginalRequestPathTypeKey ContextOriginalRequestPathType
|
2020-08-24 13:22:10 -04:00
|
|
|
|
|
|
|
|
// RecoveryTokenValidityPeriod is exported so we can modify it in tests if
|
|
|
|
|
// we want
|
|
|
|
|
RecoveryTokenValidityPeriod = 5 * time.Minute
|
2020-02-12 13:53:27 -05:00
|
|
|
)
|