Documentation ¶
Index ¶
- Constants
- Variables
- func HTTPStatusCode(e Error) int
- func IDOf(entity interface{}) string
- func NameOf(entity interface{}) string
- type APIProduct
- type APIProducts
- type Attribute
- type Attributes
- func (a *Attributes) Delete(name string) (valueOfDeletedAttribute string, e Error)
- func (a *Attributes) Get(name string) (string, Error)
- func (a *Attributes) GetAsDuration(name string, defaultDuration time.Duration) time.Duration
- func (a *Attributes) GetAsString(name, defaultValue string) string
- func (a *Attributes) GetAsUInt32(name string, defaultValue uint32) uint32
- func (a *Attributes) Set(attributeValue *Attribute) Error
- func (a *Attributes) SetMultiple(attributeValues Attributes) Error
- func (a Attributes) Sort()
- func (a *Attributes) Tidy()
- func (a Attributes) Validate() error
- type Audit
- type Audits
- type Cluster
- type Clusters
- type Companies
- type Company
- type Developer
- type DeveloperApp
- type DeveloperApps
- type Developers
- type Error
- func NewBadRequestError(details error) Error
- func NewDatabaseError(details error) Error
- func NewForbiddenError(details error) Error
- func NewItemNotFoundError(details error) Error
- func NewNotAcceptable(details error) Error
- func NewUnauthorizedError(details error) Error
- func NewUpdateFailureError(details error) Error
- type Key
- type KeyAPIProductStatus
- type KeyAPIProductStatuses
- type Keys
- type Listener
- type Listeners
- type OAuthAccessToken
- type Organization
- type Organizations
- type Permission
- type Permissions
- type Role
- type Roles
- type Route
- type Routes
- type User
- type Users
Constants ¶
const ( // Hostname of cluster AttributeHost = "Host" // Port of cluster AttributePort = "Port" // Timeout for new network connections to cluster AttributeConnectTimeout = "ConnectTimeout" // Tdle timeout for connections, for the period in which there are no active requests AttributeIdleTimeout = "IdleTimeout" // Determines whether to enable TLS or not, HTTP/2 always uses TLS AttributeTLS = "TLS" // Holds hostname to send during TLS handshake (if not set a cluster's hostname will be used) AttributeSNIHostName = "SNIHostName" // Sets network protocol to use for health check AttributeHealthCheckProtocol = "HealthCheckProtocol" // Determines host header to use for health check AttributeHealthHostHeader = "HealthCheckHostHeader" // Determines http path of health check probe AttributeHealthCheckPath = "HealthCheckPath" // Health check interval for probes AttributeHealthCheckInterval = "HealthCheckInterval" // Health check timeout AttributeHealthCheckTimeout = "HealthCheckTimeout" // Threshold of attempts before declaring cluster unhealthly AttributeHealthCheckUnhealthyThreshold = "HealthCheckUnhealthyThreshold" // Threshold of attempts before declaring cluster healthly AttributeHealthCheckHealthyThreshold = "HealthCheckHealthyThreshold" // Logfile name for healthcheck probes AttributeHealthCheckLogFile = "HealthCheckLogFile" // Maximum number of connects to cluster AttributeMaxConnections = "MaxConnections" // Maximum number of pending cluster requests AttributeMaxPendingRequests = "MaxPendingRequests" // Maximum number of parallel requests to cluster AttributeMaxRequests = "MaxRequests" // Maximum number of retries to cluster AttributeMaxRetries = "MaxRetries" // IP network address family to use for contacting cluster AttributeDNSLookupFamily = "DNSLookupFamily" // dns resolving using v4 only AttributeValueDNSIPV4Only = "V4_ONLY" // dns resolving using v6 only AttributeValueDNSIPV6Only = "V6_ONLY" // dns resolving via both v4 & v6 AttributeValueDNSAUTO = "AUTO" // Refresh rate for resolving cluster hostname AttributeDNSRefreshRate = "DNSRefreshRate" // Resolver ip address(es) to use for dns resolution (multiple can be comma separated) AttributeDNSResolvers = "DNSResolvers" AttributeLbPolicy = "LbPolicy" AttributeValueLBRoundRobin = "ROUND_ROBIN" AttributeValueLBLeastRequest = "LEAST_REQUEST" AttributeValueLBRingHash = "RING_HASH" AttributeValueLBRandom = "RANDOM" AttributeValueLBMaglev = "MAGLEV" // Default connection timeout DefaultClusterConnectTimeout = 5 * time.Second // Default cluster connect idle timeout DefaultClusterIdleTimeout = 15 * time.Minute // Default health check interval DefaultHealthCheckInterval = 5 * time.Second // Default health check timeout DefaultHealthCheckTimeout = 10 * time.Second // Default unhealthy threshold DefaultHealthCheckUnhealthyThreshold = 2 // Default healthy threshold DefaultHealthCheckHealthyThreshold = 2 // Default dns resolution interval of cluster hostname DefaultDNSRefreshRate = 5 * time.Second )
Cluster specific attributes
const ( AttributeListenerFilters = "Filters" // File for storing access logs AttributeAccessLogFile = "AccessLogFile" // Field configuration for access logging to file AttributeAccessLogFileFields = "AccessLogFileFields" // Cluster to send access logs to AttributeAccessLogCluster = "AccessLogCluster" // In memory buffer size for access logs AttributeAccessLogClusterBufferSize = "AccessLogClusterBufferSize" // Server name to respond with AttributeServerName = "ServerName" // HTTP/2 max concurrent streams per connection AttributeMaxConcurrentStreams = "MaxConcurrentStreams" // HTTP/2 initial connection window size AttributeInitialConnectionWindowSize = "InitialConnectionWindowSize" // HTTP/2 initial window size AttributeInitialStreamWindowSize = "InitialStreamWindowSize" // Name of extzauth cluster AttributeExtAuthzCluster = "ExtAuthzCluster" // Extauthz cluster request timeout AttributeExtAuthzTimeout = "ExtAuthzTimeout" // Are requests allowed in case authentication times out AttributeExtAuthzFailureModeAllow = "ExtAuthzFailureModeAllow" // Number of bytes of POST request to include in authentication request AttributeExtAuthzRequestBodySize = "ExtAuthzRequestBodySize" // Organization to be used for lookups by envoyauth when authentication requests AttributeOrganization = "Organization" // Ratelimiting AttributeRateLimitingCluster = "RateLimitingCluster" // AttributeRateLimitingTimeout = "RateLimitingTimeout" // AttributeRateLimitingDomain = "RateLimitingDomain" // AttributeRateLimitingFailureModeAllow = "RateLimitingFailureModeAllow" )
listener specific attributes
const ( // AttributeTLSCertificate holds pem encoded certicate AttributeTLSCertificate = "TLSCertificate" // AttributeTLSCertificateKey holds certicate key AttributeTLSCertificateKey = "TLSCertificateKey" // AttributeTLSCertificateFile holds filename of pem encoded certicate AttributeTLSCertificateFile = "TLSCertificateFile" // AttributeTLSCertificateKeyFile holds filename of certicate key AttributeTLSCertificateKeyFile = "TLSCertificateKeyFile" // AttributeTLSMinimumVersion determines minimum TLS version accepted AttributeTLSMinimumVersion = "TLSMinimumVersion" // AttributeTLSMaximumVersion determines maximum TLS version accepted AttributeTLSMaximumVersion = "TLSMaximumVersion" // AttributeTLSCipherSuites determines set of allowed TLS ciphers AttributeTLSCipherSuites = "TLSCipherSuites" // AttributeTLSCipherSuites sets HTTP protocol to accept AttributeHTTPProtocol = "HTTPProtocol" AttributeValueTrue = "true" AttributeValueFalse = "false" AttributeValueTLSVersion10 = "TLS1.0" AttributeValueTLSVersion11 = "TLS1.1" AttributeValueTLSVersion12 = "TLS1.2" AttributeValueTLSVersion13 = "TLS1.3" AttributeValueHTTPProtocol11 = "HTTP/1.1" AttributeValueHTTPProtocol2 = "HTTP/2" AttributeValueHTTPProtocol3 = "HTTP/3" AttributeValueHealthCheckProtocolHTTP = "HTTP" )
Attributes which are shared amongst listener, route and cluster
const ( // Name of upstream cluster to forward requests to AttributeCluster = "Cluster" // Weighted list of clusters to load balance requests across AttributeWeightedClusters = "WeightedClusters" // Enable/disable authentication via extauthz AttributeRouteExtAuthz = "ExtAuthz" // // Enable ratelimiting AttributeRouteRateLimiting = "RateLimiting" // Return an arbitrary HTTP response directly, without proxying AttributeDirectResponseStatusCode = "DirectResponseStatusCode" // Responsebody to return when direct response is done AttributeDirectResponseBody = "DirectResponseBody" // Return an HTTP redirect AttributeRedirectStatusCode = "RedirectStatusCode" // HTTP scheme when generating a redirect AttributeRedirectScheme = "RedirectScheme" // Hostname when generating a redirect AttributeRedirectHostName = "RedirectHostName" // Port when generating a redirect AttributeRedirectPort = "RedirectPort" // Path when generating a redirect AttributeRedirectPath = "RedirectPath" // Enable removal of query parameters when redirecting AttributeRedirectStripQuery = "RedirectStripQuery" // Rewrites path when contacting upstream AttributePrefixRewrite = "PrefixRewrite" // Whether the resource allows credentials AttributeCORSAllowCredentials = "CORSAllowCredentials" // Value of Access-Control-Allow-Methods header AttributeCORSAllowMethods = "CORSAllowMethods" // Value of Access-Control-Allow-Headers header AttributeCORSAllowHeaders = "CORSAllowHeaders" // Value of Access-Control-Expose-Headers header AttributeCORSExposeHeaders = "CORSExposeHeaders" // Value of Access-Control-Expose-Headers header AttributeCORSMaxAge = "CORSMaxAge" // Host header to set when forwarding to upstream cluster AttributeHostHeader = "HostHeader" // Additional header 1 to set before forwarding upstream AttributeRequestHeaderToAdd1 = "RequestHeaderToAdd1" // Additional header 2 to set before forwarding upstream AttributeRequestHeaderToAdd2 = "RequestHeaderToAdd2" // Additional header 3 to set before forwarding upstream AttributeRequestHeaderToAdd3 = "RequestHeaderToAdd3" // Additional header 4 to set before forwarding upstream AttributeRequestHeaderToAdd4 = "RequestHeaderToAdd4" // Additional header 5 to set before forwarding upstream AttributeRequestHeaderToAdd5 = "RequestHeaderToAdd5" // Optional header(s) to remove before forwarding upstream AttributeRequestHeadersToRemove = "RequestHeadersToRemove" // Basic authentication header to set before forwarding upstream AttributeBasicAuth = "BasicAuth" // Conditions under which retry takes place AttributeRetryOn = "RetryOn" // Upstream timeout per retry attempt AttributePerTryTimeout = "PerTryTimeout" // Max number of retry attempts AttributeNumRetries = "NumRetries" // Upstream status codes which are to be retried AttributeRetryOnStatusCodes = "RetryOnStatusCodes" // Cluster to mirror requests to AttributeRequestMirrorCluster = "RequestMirrorCluster" // Percentage of traffic traffic to mirror requests to AttributeRequestMirrorPercentage = "RequestMirrorPercentage" // Tineout for cluster communication AttributeTimeout = "Timeout" // RouteType path will check for an exact match AttributeValuePathTypePath = "path" // RouteType prefix will match path starting with prefix AttributeValuePathTypePrefix = "prefix" // RouteType regexp will path regexp match AttributeValuePathTypeRegexp = "regexp" // Default route timeout DefaultRouteTimeout = 20 * time.Second // Default per retry timeout DefaultPerRetryTimeout = 500 * time.Millisecond // Default retry count DefaultNumRetries = 2 // Default retry-on status codes DefaultRetryStatusCodes = "500,503,504" )
Attributes supported on a route
const ( TypeListenerName = "listener" TypeRouteName = "route" TypeClusterName = "cluster" TypeOrganizationName = "organization" TypeCompanyName = "company" TypeDeveloperName = "developer" TypeDeveloperAppName = "developerapp" TypeAPIProductName = "apiproduct" TypeKeyName = "key" TypeOAuthName = "oauth" TypeUserName = "user" TypeRoleName = "role" )
Entity types we handle
Variables ¶
var ( // NullAPIProduct is an empty apiproduct type NullAPIProduct = APIProduct{} // NullAPIProducts is an empty apiproduct slice NullAPIProducts = APIProducts{} )
var ( // NullAttribute is an empty attribute type NullAttribute = Attribute{} // NullAttributes is an empty attributes slice NullAttributes = Attributes{} // Maximum number of attributes allowed in set MaximumNumberofAttributesAllowed = 100 )
var ( // NullAudit is an empty audit type NullAudit = Audit{} // NullAudits is an empty audit slice NullAudits = Audits{} )
var ( // NullCluster is an empty cluster type NullCluster = Cluster{} // NullClusters is an empty cluster slice NullClusters = Clusters{} )
var ( // NullCompany is an empty company type NullCompany = Company{} // NullCompanies is an empty company slice NullCompanies = Companies{} )
var ( // NullDeveloper is an empty developer type NullDeveloper = Developer{} // NullDevelopers is an empty developer slice NullDevelopers = Developers{} )
var ( // NullDeveloperApp is an empty developer app type NullDeveloperApp = DeveloperApp{} // NullDeveloperApps is an empty developer app slice NullDeveloperApps = DeveloperApps{} )
var ( // NullDeveloperAppKey is an empty key type NullDeveloperAppKey = Key{} // NullDeveloperAppKeys is an empty key slice NullDeveloperAppKeys = Keys{} )
var ( // NullListener is an empty listener type NullListener = Listener{} // NullListeners is an empty listener slice NullListeners = Listeners{} )
var ( // NullOrganization is an empty organization type NullOrganization = Organization{} // NullOrganizations is an empty organization slice NullOrganizations = Organizations{} )
var ( // NullRole is an empty role type NullRole = Role{} // NullRoles is an empty role slice NullRoles = Roles{} // NullPermission is an allow type NullPermission = Permission{} // NullPermissions is an allows type NullPermissions = Permissions{} )
var ( // NullRoute is an empty route type NullRoute = Route{} // NullRoutes is an empty route slice NullRoutes = Routes{} )
var ( // NullUser is an empty user type NullUser = User{} // NullUsers is an empty user slice NullUsers = Users{} )
Functions ¶
func HTTPStatusCode ¶
HTTPStatusCode returns HTTP status code for Error type
Types ¶
type APIProduct ¶
type APIProduct struct { // Name of apiproduct (not changable) Name string `validate:"required,min=1"` // Routegroup this apiproduct should match to RouteGroup string // List of paths this apiproduct applies to APIResources []string `binding:"required,min=1"` // List of scopes that apply to this product Scopes []string // Approval type of this apiproduct ApprovalType string // Attributes of this apiproduct Attributes Attributes // Friendly display name of route DisplayName string // Full description of this api product Description string // Comma separated list of policynames, to apply to requests Policies string // Created at timestamp in epoch milliseconds CreatedAt int64 // Name of user who created this apiproduct CreatedBy string // Last modified at timestamp in epoch milliseconds LastModifiedAt int64 // Name of user who last updated this apiproduct LastModifiedBy string }
APIProduct type contains everything about an API product
Field validation (binding) is done using https://godoc.org/github.com/go-playground/validator
func (*APIProduct) Validate ¶
func (a *APIProduct) Validate() error
Validate checks if field values are set correct and are allowed
type Attribute ¶
type Attribute struct { // Attribute name, minimum required length is 1 Name string `validate:"required,min=1"` // Attribute value Value string `validate:"required"` }
Attribute is an array with attributes
Field validation settings (binding) are validated with https://godoc.org/github.com/go-playground/validator
func NewAttribute ¶
NewAttribute creates a new attribute
type Attributes ¶
type Attributes []Attribute
Attributes holds one or more attributes
func (*Attributes) Delete ¶
func (a *Attributes) Delete(name string) (valueOfDeletedAttribute string, e Error)
Delete removes attribute from slice. Returns delete status and deleted attribute's value
func (*Attributes) Get ¶
func (a *Attributes) Get(name string) (string, Error)
Get return one named attribute from attributes
func (*Attributes) GetAsDuration ¶
GetAsDuration returns attribute value (or provided default) as type time.Duration
func (*Attributes) GetAsString ¶
func (a *Attributes) GetAsString(name, defaultValue string) string
GetAsString returns attribute value (or provided default if not found) as type string
func (*Attributes) GetAsUInt32 ¶
func (a *Attributes) GetAsUInt32(name string, defaultValue uint32) uint32
GetAsUInt32 returns attribute value (or provided default) as type integer
func (*Attributes) Set ¶
func (a *Attributes) Set(attributeValue *Attribute) Error
Set updates or adds attribute in slice. Returns old value if attribute already existed.
func (*Attributes) SetMultiple ¶
func (a *Attributes) SetMultiple(attributeValues Attributes) Error
SetMultiple updates or adds multiple attribute. Returns error in case of isses
func (*Attributes) Tidy ¶
func (a *Attributes) Tidy()
Tidy removes duplicate, trims all names & values and sorts attribute by name
func (Attributes) Validate ¶
func (a Attributes) Validate() error
Validate checks if field values are set correct and are allowed
type Audit ¶
type Audit struct { // Unique id ID string // Event timestamp in epoch milliseconds Timestamp int64 AuditType string IPaddress string RequestID string Role string User string UserAgent string Organization string Company string DeveloperID string AppID string EntityType string EntityID string OldValue map[string]interface{} NewValue map[string]interface{} }
Audit holds an audit
type Cluster ¶
type Cluster struct { // Name of cluster (not changable) Name string `validate:"required,min=1"` // Friendly display name of cluster DisplayName string // Attributes of this cluster Attributes Attributes // Created at timestamp in epoch milliseconds CreatedAt int64 // Name of user who created this cluster CreatedBy string // Last modified at timestamp in epoch milliseconds LastModifiedAt int64 // Name of user who last updated this cluster LastModifiedBy string }
Cluster holds configuration of an upstream cluster
Field validation (binding) is done using https://godoc.org/github.com/go-playground/validator
type Company ¶
type Company struct { // Name of company (not changable) Name string `validate:"required,min=1,max=100"` // Friendly display name of company DisplayName string // Attributes of company Attributes Attributes // Status of company Status string // Name of applications of this company Apps []string // Created at timestamp in epoch milliseconds CreatedAt int64 // Name of user who created this company CreatedBy string // Last modified at timestamp in epoch milliseconds LastModifiedAt int64 // Name of user who last updated this company LastModifiedBy string }
Company holds details of a company
func (*Company) Deactivate ¶
func (c *Company) Deactivate()
Deactivate marks a developer as inactive
type Developer ¶
type Developer struct { // Id of developer (not changable) DeveloperID string // Status of developer (should be "approved" to allow access) Status string // Name of developer applications of this developer Apps []string // Attributes of developer Attributes Attributes // Email address Email string `validate:"required,email"` // Username UserName string // First name FirstName string // Last name LastName string // Organization name OrganizationName string // Created at timestamp in epoch milliseconds CreatedAt int64 // Name of user who created this organiz CreatedBy string // Last modified at timestamp in epoch milliseconds LastModifiedAt int64 // Name of user who last updated this developer LastModifiedBy string }
Developer contains everything about a Developer
func (*Developer) Deactivate ¶
func (d *Developer) Deactivate()
Deactivate marks a developer as inactive
type DeveloperApp ¶
type DeveloperApp struct { // Id of developer app (not changable) AppID string // Id of developer (not changable) DeveloperID string // Activation status of developer application Status string // Attributes of developer application Attributes Attributes // Name of developer application Name string `validate:"required,min=1"` // Friendly name of developer app DisplayName string // OAuth scopes Scopes []string // OAuth call back URL CallbackURL string // Created at timestamp in epoch milliseconds CreatedAt int64 // Name of user who created this app CreatedBy string // Last modified at timestamp in epoch milliseconds LastModifiedAt int64 // Name of user who last updated this app LastModifiedBy string }
DeveloperApp contains everything about a Developer Application
func (*DeveloperApp) Approve ¶
func (d *DeveloperApp) Approve()
Activate marks a developer as approved
func (*DeveloperApp) IsActive ¶
func (d *DeveloperApp) IsActive() bool
IsActive returns true in case developer's status is active
func (*DeveloperApp) Revoke ¶
func (d *DeveloperApp) Revoke()
Deactivate marks a developer as inactive
func (*DeveloperApp) Validate ¶
func (d *DeveloperApp) Validate() error
Validate checks if field values are set correct and are allowed
type DeveloperApps ¶
type DeveloperApps []DeveloperApp
DeveloperApps holds one or more developer apps
type Error ¶
Error is our error type providing additional (internal error detail
func NewBadRequestError ¶
NewBadRequestError returns a bad request error
func NewDatabaseError ¶
NewDatabaseError returns a database error
func NewForbiddenError ¶
NewForbiddenError returns a forbidden action error
func NewItemNotFoundError ¶
NewItemNotFoundError returns a item not found error
func NewNotAcceptable ¶
NewNotAcceptable returns a not acceptable error
func NewUnauthorizedError ¶
NewUnauthorizedError returns an unauthorized error
func NewUpdateFailureError ¶
NewUpdateFailureError returns a item not found error
type Key ¶
type Key struct { // ConsumerKey is the key required for authentication ConsumerKey string `validate:"required,min=1"` // ConsumerSecret is secretid of this key, needed to request OAuth2 access token ConsumerSecret string `validate:"required,min=1"` // List of apiproducts which can be accessed using this key APIProducts KeyAPIProductStatuses // List of scopes this key has Scopes []string // Expiry date in epoch milliseconds ExpiresAt int64 // Issue date in epoch milliseconds IssuedAt int64 // Attributes of key Attributes Attributes // Developer app id this key belongs to AppID string // Status (should be "approved" to allow access) Status string }
Key contains an apikey entitlement
Field validation (binding) is done using https://godoc.org/github.com/go-playground/validator
func (*Key) IsApproved ¶
IsApproved returns true in case key's status is approved
type KeyAPIProductStatus ¶
type KeyAPIProductStatus struct { // Name of apiproduct Apiproduct string `json:"apiProduct"` // Status (should be "approved" to allow access) Status string `json:"status"` }
KeyAPIProductStatus contains whether an apikey's assigned apiproduct has been approved
func (*KeyAPIProductStatus) IsApproved ¶
func (p *KeyAPIProductStatus) IsApproved() bool
IsApproved returns true in case key's apiproduct status is approved
func (*KeyAPIProductStatus) SetApproved ¶
func (p *KeyAPIProductStatus) SetApproved()
SetApproved marks a key's apiproduct as approved
type KeyAPIProductStatuses ¶
type KeyAPIProductStatuses []KeyAPIProductStatus
KeyAPIProductStatuses contains list of apiproducts
func (KeyAPIProductStatuses) AddProducts ¶
func (p KeyAPIProductStatuses) AddProducts(apiproductNames *[]string) KeyAPIProductStatuses
AddProducts adds one or more apiproduct to a key's assigned products and returns an updated slice
func (KeyAPIProductStatuses) ChangeStatus ¶
func (p KeyAPIProductStatuses) ChangeStatus(apiproductName, newProductStatus string) KeyAPIProductStatuses
ChangeStatus changes the status of one apiproduct and returns an updated slice
func (KeyAPIProductStatuses) RemoveProduct ¶
func (p KeyAPIProductStatuses) RemoveProduct(apiproductName string) KeyAPIProductStatuses
RemoveProduct removes one apiproduct from a key's assigned products and returns an updated slice
type Listener ¶
type Listener struct { // Name of listener (not changable) Name string `validate:"required,min=1"` // Friendly display name of listener DisplayName string // Virtual hosts of this listener (at least one, each value must be a fqdn) VirtualHosts []string `validate:"required,min=1,dive,fqdn"` // tcp port to listen on Port int `validate:"required,min=1,max=65535"` // Routegroup to forward traffic to RouteGroup string `validate:"required"` // Comma separated list of policynames, to apply to requests Policies string // Attributes of this listener Attributes Attributes // Created at timestamp in epoch milliseconds CreatedAt int64 // Name of user who created this listener CreatedBy string // Last modified at timestamp in epoch milliseconds LastModifiedAt int64 // Name of user who last updated this listener LastModifiedBy string }
Listener contains everything about downstream configuration of listener and http virtual hosts
type OAuthAccessToken ¶
type OAuthAccessToken struct { ClientID string `json:"client_id"` UserID string `json:"user_id"` RedirectURI string `json:"redirect_uri"` Scope string `json:"scope"` Code string `json:"code"` CodeCreatedAt int64 `json:"code_created_at"` CodeExpiresIn int64 `json:"code_expires_in"` Access string `json:"access"` AccessCreatedAt int64 `json:"access_created_at"` AccessExpiresIn int64 `json:"access_expires_in"` Refresh string `json:"refresh"` RefreshCreatedAt int64 `json:"refresh_created_at"` RefreshExpiresIn int64 `json:"refresh_expires_in"` }
OAuthAccessToken holds details of an issued OAuth token
type Organization ¶
type Organization struct { // Name of organization (not changable) Name string `validate:"required,min=1,max=100"` // Friendly display name of organization DisplayName string // Attributes of this organization Attributes Attributes // Created at timestamp in epoch milliseconds CreatedAt int64 // Name of user who created this organization CreatedBy string // Last modified at timestamp in epoch milliseconds LastModifiedAt int64 // Name of user who last updated this organization LastModifiedBy string }
Organization holds details of an organization
func (*Organization) Validate ¶
func (o *Organization) Validate() error
Validate checks if field values are set correct and are allowed
type Organizations ¶
type Organizations []Organization
Organizations holds one or more Organizations
type Permission ¶
type Permission struct { // Request methods which are allowed // FIXME these bindings settings do not get used... Methods []string `validate:"dive,oneof=GET POST PUT PATCH DELETE,required"` // Request paths (regexp) which are allowed Paths []string `validate:"dive,startswith=/,required"` }
Permission holds the criteria a role will allow request
type Role ¶
type Role struct { // Name of role (not changable) Name string `validate:"required,min=1,max=100"` // Display name DisplayName string // Allowed methods & paths Permissions `validate:"required"` // Created at timestamp in epoch milliseconds CreatedAt int64 // Name of user who created this role CreatedBy string // Last modified at timestamp in epoch milliseconds LastModifiedAt int64 // Name of user who last updated this role LastModifiedBy string }
Role holds an role
func (*Role) IsPathAllowed ¶
IsPathAllowed checks whether role is allowed to access a path
type Route ¶
type Route struct { // Name of route (not changable) Name string `binding:"required,min=4"` // Friendly display name of route DisplayName string // Routegroup this route is part of RouteGroup string `binding:"required,min=4"` // Path of route (should always start with a /) Path string `binding:"required,min=1,startswith=/"` // Type of pathmatching: path, prefix, regexp PathType string `binding:"required,oneof=path prefix regexp"` // Attributes of this route Attributes Attributes // Created at timestamp in epoch milliseconds CreatedAt int64 // Name of user who created this route CreatedBy string // Last modified at timestamp in epoch milliseconds LastModifiedAt int64 // Name of user who last updated this route LastModifiedBy string }
Route holds configuration of a route
Field validation (binding) is done using https://godoc.org/github.com/go-playground/validator
type User ¶
type User struct { // Name of user (not changable) Name string `validate:"required,min=1,max=100"` // Display name DisplayName string // Password Password string // Status of this user Status string // Role of this user Roles []string // Created at timestamp in epoch milliseconds CreatedAt int64 // Name of user who created this user CreatedBy string // Last modified at timestamp in epoch milliseconds LastModifiedAt int64 // Name of user who last updated this user LastModifiedBy string }
User holds an user