Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for ToRoutingClaim (0.18 sec)

  1. pkg/config/analysis/analyzers/virtualservice/jwtclaimroute.go

    	for _, httpRoute := range vs.GetHttp() {
    		for _, match := range httpRoute.GetMatch() {
    			for key := range match.GetHeaders() {
    				if jwt.ToRoutingClaim(key).Match {
    					return key
    				}
    			}
    			for key := range match.GetWithoutHeaders() {
    				if jwt.ToRoutingClaim(key).Match {
    					return key
    				}
    			}
    		}
    	}
    	return ""
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 11 16:38:57 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  2. pkg/jwt/routing.go

    type Separator int
    
    const (
    	Dot Separator = iota
    	Square
    )
    
    type RoutingClaim struct {
    	Match     bool
    	Separator Separator
    	Claims    []string
    }
    
    func ToRoutingClaim(headerName string) RoutingClaim {
    	rc := RoutingClaim{}
    	if !strings.HasPrefix(strings.ToLower(headerName), HeaderJWTClaim) {
    		return rc
    	}
    
    	name := headerName[len(HeaderJWTClaim):]
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 11 16:38:57 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  3. pkg/jwt/routing_test.go

    			want: RoutingClaim{Match: true, Separator: Square, Claims: []string{"******@****.***", "key1"}},
    		},
    	}
    
    	for _, tt := range cases {
    		t.Run(tt.name, func(t *testing.T) {
    			got := ToRoutingClaim(tt.name)
    			if !reflect.DeepEqual(got, tt.want) {
    				t.Errorf("want %v, but got %v", tt.want, got)
    			}
    		})
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 11 16:38:57 UTC 2023
    - 3K bytes
    - Viewed (0)
  4. pilot/pkg/networking/core/route/route.go

    // - `@request.auth.claims[group][id]` matches the nested claims "group" and "id".
    func translateMetadataMatch(name string, in *networking.StringMatch, useExtendedJwt bool) *matcher.MetadataMatcher {
    	rc := jwt.ToRoutingClaim(name)
    	if !rc.Match {
    		return nil
    	}
    	return authz.MetadataMatcherForJWTClaims(rc.Claims, util.ConvertToEnvoyMatch(in), useExtendedJwt)
    }
    
    // translateHeaderMatch translates to HeaderMatcher
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 14 14:12:39 UTC 2024
    - 56.1K bytes
    - Viewed (0)
  5. pkg/config/validation/validation.go

    func ValidateHTTPHeaderNameOrJwtClaimRoute(name string) error {
    	if name == "" {
    		return fmt.Errorf("header name cannot be empty")
    	}
    	if jwt.ToRoutingClaim(name).Match {
    		// Jwt claim form
    		return nil
    	}
    	// Else ensure its a valid header
    	if !validHeaderRegex.MatchString(name) {
    		return fmt.Errorf("header name %s is not a valid header name", name)
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jun 12 04:03:33 UTC 2024
    - 107.2K bytes
    - Viewed (0)
Back to top