...

Source file src/github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v2/crd_authservice.go

Documentation: github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v2

     1  // Copyright 2020 Datawire.  All rights reserved
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  ///////////////////////////////////////////////////////////////////////////
    16  // Important: Run "make update-yaml" to regenerate code after modifying
    17  // this file.
    18  ///////////////////////////////////////////////////////////////////////////
    19  
    20  package v2
    21  
    22  import (
    23  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    24  )
    25  
    26  type AuthServiceIncludeBody struct {
    27  	// These aren't pointer types because they are required.
    28  	// +kubebuilder:validation:Required
    29  	MaxBytes int `json:"max_bytes,omitempty"`
    30  
    31  	// +kubebuilder:validation:Required
    32  	AllowPartial bool `json:"allow_partial,omitempty"`
    33  }
    34  
    35  // Why isn't this just an int??
    36  type AuthServiceStatusOnError struct {
    37  	Code int `json:"code,omitempty"`
    38  }
    39  
    40  // AuthServiceSpec defines the desired state of AuthService
    41  type AuthServiceSpec struct {
    42  	AmbassadorID AmbassadorID `json:"ambassador_id,omitempty"`
    43  
    44  	// +kubebuilder:validation:Required
    45  	AuthService string `json:"auth_service,omitempty"`
    46  	PathPrefix  string `json:"path_prefix,omitempty"`
    47  	// +k8s:conversion-gen=false
    48  	TLS *BoolOrString `json:"tls,omitempty"`
    49  	// +kubebuilder:validation:Enum={"http","grpc"}
    50  	Proto                       string                    `json:"proto,omitempty"`
    51  	Timeout                     *MillisecondDuration      `json:"timeout_ms,omitempty"`
    52  	AllowedRequestHeaders       []string                  `json:"allowed_request_headers,omitempty"`
    53  	AllowedAuthorizationHeaders []string                  `json:"allowed_authorization_headers,omitempty"`
    54  	AddAuthHeaders              map[string]string         `json:"add_auth_headers,omitempty"`
    55  	AllowRequestBody            *bool                     `json:"allow_request_body,omitempty"`
    56  	AddLinkerdHeaders           *bool                     `json:"add_linkerd_headers,omitempty"`
    57  	FailureModeAllow            *bool                     `json:"failure_mode_allow,omitempty"`
    58  	IncludeBody                 *AuthServiceIncludeBody   `json:"include_body,omitempty"`
    59  	StatusOnError               *AuthServiceStatusOnError `json:"status_on_error,omitempty"`
    60  	// +kubebuilder:validation:Enum={"v2","v3"}
    61  	ProtocolVersion string `json:"protocol_version,omitempty"`
    62  
    63  	// +k8s:conversion-gen:rename=StatsName
    64  	V3StatsName string `json:"v3StatsName,omitempty"`
    65  	// +k8s:conversion-gen:rename=CircuitBreakers
    66  	V3CircuitBreakers []*CircuitBreaker `json:"v3CircuitBreakers,omitempty"`
    67  }
    68  
    69  // AuthService is the Schema for the authservices API
    70  //
    71  // +kubebuilder:object:root=true
    72  // +kubebuilder:storageversion
    73  type AuthService struct {
    74  	metav1.TypeMeta   `json:""`
    75  	metav1.ObjectMeta `json:"metadata,omitempty"`
    76  
    77  	Spec AuthServiceSpec `json:"spec,omitempty"`
    78  }
    79  
    80  // AuthServiceList contains a list of AuthServices.
    81  //
    82  // +kubebuilder:object:root=true
    83  type AuthServiceList struct {
    84  	metav1.TypeMeta `json:""`
    85  	metav1.ListMeta `json:"metadata,omitempty"`
    86  	Items           []AuthService `json:"items"`
    87  }
    88  
    89  func init() {
    90  	SchemeBuilder.Register(&AuthService{}, &AuthServiceList{})
    91  }
    92  

View as plain text