Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for HeaderMatcher (0.4 sec)

  1. pilot/pkg/security/authz/matcher/header.go

    )
    
    // HeaderMatcher converts a key, value string pair to a corresponding HeaderMatcher.
    func HeaderMatcher(k, v string) *routepb.HeaderMatcher {
    	// We must check "*" first to make sure we'll generate a non empty value in the prefix/suffix case.
    	// Empty prefix/suffix value is invalid in HeaderMatcher.
    	if v == "*" {
    		return &routepb.HeaderMatcher{
    			Name: k,
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Aug 17 22:42:11 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  2. pilot/pkg/security/authz/matcher/header_test.go

    )
    
    func TestHeaderMatcher(t *testing.T) {
    	testCases := []struct {
    		Name   string
    		K      string
    		V      string
    		Expect *routepb.HeaderMatcher
    	}{
    		{
    			Name: "exact match",
    			K:    ":path",
    			V:    "/productpage",
    			Expect: &routepb.HeaderMatcher{
    				Name: ":path",
    				HeaderMatchSpecifier: &routepb.HeaderMatcher_StringMatch{
    					StringMatch: StringMatcherExact("/productpage", false),
    				},
    			},
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Aug 17 22:42:11 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness_test.go

    		headerMatcher := headerMatcher{}
    		rquestTimesOutPath := "/request/time-out-as-designed"
    		reqHandlerCompletedCh, callerRoundTripDoneCh := make(chan struct{}), make(chan struct{})
    		requestHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    			headerMatcher.inspect(t, w, fsName, plName)
    
    			if r.URL.Path == rquestTimesOutPath {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 30 12:18:40 UTC 2023
    - 52.6K bytes
    - Viewed (0)
  4. tests/fuzz/pilot_security_fuzzer.go

    	_, _ = util.AddrStrToCidrRange(string(data))
    	return 1
    }
    
    func FuzzHeaderMatcher(data []byte) int {
    	k, v, err := getKandV(data)
    	if err != nil {
    		return 0
    	}
    	_ = matcher.HeaderMatcher(k, v)
    	return 1
    }
    
    func FuzzHostMatcherWithRegex(data []byte) int {
    	k, v, err := getKandV(data)
    	if err != nil {
    		return 0
    	}
    	_ = matcher.HostMatcherWithRegex(k, v)
    	return 1
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Nov 20 22:15:12 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  5. pilot/pkg/security/authz/model/principal.go

    	return &rbacpb.Principal{
    		Identifier: &rbacpb.Principal_Metadata{
    			Metadata: metadata,
    		},
    	}
    }
    
    func principalHeader(header *routepb.HeaderMatcher) *rbacpb.Principal {
    	return &rbacpb.Principal{
    		Identifier: &rbacpb.Principal_Header{
    			Header: header,
    		},
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Nov 17 18:44:57 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  6. pilot/pkg/security/authz/model/permission.go

    	return &rbacpb.Permission{
    		Rule: &rbacpb.Permission_Metadata{
    			Metadata: metadata,
    		},
    	}
    }
    
    func permissionHeader(header *routepb.HeaderMatcher) *rbacpb.Permission {
    	return &rbacpb.Permission{
    		Rule: &rbacpb.Permission_Header{
    			Header: header,
    		},
    	}
    }
    
    func permissionPath(path *matcher.PathMatcher) *rbacpb.Permission {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Apr 20 01:58:53 UTC 2024
    - 3K bytes
    - Viewed (0)
  7. pilot/pkg/security/authz/model/generator.go

    	if forTCP {
    		return nil, fmt.Errorf("%q is HTTP only", key)
    	}
    
    	header, err := extractNameInBrackets(strings.TrimPrefix(key, attrRequestHeader))
    	if err != nil {
    		return nil, err
    	}
    	m := matcher.HeaderMatcher(header, value)
    	return principalHeader(m), nil
    }
    
    type requestClaimGenerator struct{}
    
    func (requestClaimGenerator) permission(_, _ string, _ bool) (*rbacpb.Permission, error) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 03 18:02:42 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  8. pilot/pkg/networking/core/route/route_internal_test.go

    			name: "catch all prefix with headers",
    			route: &route.Route{
    				Name: "catch-all",
    				Match: &route.RouteMatch{
    					PathSpecifier: &route.RouteMatch_Prefix{
    						Prefix: "/",
    					},
    					Headers: []*route.HeaderMatcher{
    						{
    							Name: "Authentication",
    							HeaderMatchSpecifier: &route.HeaderMatcher_ExactMatch{
    								ExactMatch: "test",
    							},
    						},
    					},
    				},
    			},
    			want: false,
    		},
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat May 11 02:47:57 UTC 2024
    - 18.2K bytes
    - Viewed (0)
  9. pilot/pkg/networking/core/route/route.go

    	}
    	return authz.MetadataMatcherForJWTClaims(rc.Claims, util.ConvertToEnvoyMatch(in), useExtendedJwt)
    }
    
    // translateHeaderMatch translates to HeaderMatcher
    func translateHeaderMatch(name string, in *networking.StringMatch) *route.HeaderMatcher {
    	out := &route.HeaderMatcher{
    		Name: name,
    	}
    
    	if canBeConvertedToPresentMatch(in) {
    		out.HeaderMatchSpecifier = &route.HeaderMatcher_PresentMatch{PresentMatch: true}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 14 14:12:39 UTC 2024
    - 56.1K bytes
    - Viewed (0)
  10. pilot/pkg/networking/core/route/route_test.go

    			},
    		}}},
    		{Match: &envoyroute.RouteMatch{
    			PathSpecifier: &envoyroute.RouteMatch_SafeRegex{
    				SafeRegex: &matcher.RegexMatcher{
    					Regex: "*",
    				},
    			},
    			Headers: []*envoyroute.HeaderMatcher{
    				{
    					Name: "foo",
    					HeaderMatchSpecifier: &envoyroute.HeaderMatcher_StringMatch{
    						StringMatch: &matcher.StringMatcher{MatchPattern: &matcher.StringMatcher_Exact{Exact: "bar"}},
    					},
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 14 14:12:39 UTC 2024
    - 88.1K bytes
    - Viewed (0)
Back to top