Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ToRoutingClaim (0.12 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)
Back to top