...

Source file src/github.com/datawire/ambassador/v2/pkg/api/getambassador.io/v3alpha1/crd_authservice.go

Documentation: github.com/datawire/ambassador/v2/pkg/api/getambassador.io/v3alpha1

     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 generate-fast" to regenerate code after modifying
    17  // this file.
    18  ///////////////////////////////////////////////////////////////////////////
    19  
    20  package v3alpha1
    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  // TODO(lukeshu): In v3alpha2, consider getting rid of this struct type in favor of just using an
    36  // int (i.e. `statusOnError: 500` instead of the current `statusOnError: { code: 500 }`).
    37  type AuthServiceStatusOnError struct {
    38  	Code int `json:"code,omitempty"`
    39  }
    40  
    41  // AuthServiceSpec defines the desired state of AuthService
    42  type AuthServiceSpec struct {
    43  	AmbassadorID AmbassadorID `json:"ambassador_id,omitempty"`
    44  
    45  	// TODO(lukeshu): In v3alpha2, consider renameing `auth_service` to just `service`, for
    46  	// consistency with the other resource types.
    47  	//
    48  	// +kubebuilder:validation:Required
    49  	AuthService string `json:"auth_service,omitempty"`
    50  	PathPrefix  string `json:"path_prefix,omitempty"`
    51  	TLS         string `json:"tls,omitempty"`
    52  	// +kubebuilder:validation:Enum={"http","grpc"}
    53  	Proto                       string               `json:"proto,omitempty"`
    54  	Timeout                     *MillisecondDuration `json:"timeout_ms,omitempty"`
    55  	AllowedRequestHeaders       []string             `json:"allowed_request_headers,omitempty"`
    56  	AllowedAuthorizationHeaders []string             `json:"allowed_authorization_headers,omitempty"`
    57  	AddAuthHeaders              map[string]string    `json:"add_auth_headers,omitempty"`
    58  	// TODO(lukeshu): In v3alpha2, drop allow_request_body in favor of
    59  	// include_body. allow_request_body has been deprecated for a long time.
    60  	AllowRequestBody  *bool                     `json:"allow_request_body,omitempty"`
    61  	AddLinkerdHeaders *bool                     `json:"add_linkerd_headers,omitempty"`
    62  	FailureModeAllow  *bool                     `json:"failure_mode_allow,omitempty"`
    63  	IncludeBody       *AuthServiceIncludeBody   `json:"include_body,omitempty"`
    64  	StatusOnError     *AuthServiceStatusOnError `json:"status_on_error,omitempty"`
    65  	// +kubebuilder:validation:Enum={"v2","v3"}
    66  	ProtocolVersion string            `json:"protocol_version,omitempty"`
    67  	StatsName       string            `json:"stats_name,omitempty"`
    68  	CircuitBreakers []*CircuitBreaker `json:"circuit_breakers,omitempty"`
    69  
    70  	V2ExplicitTLS *V2ExplicitTLS `json:"v2ExplicitTLS,omitempty"`
    71  }
    72  
    73  // AuthService is the Schema for the authservices API
    74  //
    75  // +kubebuilder:object:root=true
    76  type AuthService struct {
    77  	metav1.TypeMeta   `json:""`
    78  	metav1.ObjectMeta `json:"metadata,omitempty"`
    79  
    80  	Spec AuthServiceSpec `json:"spec,omitempty"`
    81  }
    82  
    83  // AuthServiceList contains a list of AuthServices.
    84  //
    85  // +kubebuilder:object:root=true
    86  type AuthServiceList struct {
    87  	metav1.TypeMeta `json:""`
    88  	metav1.ListMeta `json:"metadata,omitempty"`
    89  	Items           []AuthService `json:"items"`
    90  }
    91  
    92  func init() {
    93  	SchemeBuilder.Register(&AuthService{}, &AuthServiceList{})
    94  }
    95  

View as plain text