mirror of
				https://github.com/containers/podman.git
				synced 2025-10-31 10:00:01 +08:00 
			
		
		
		
	Add (podman {image,manifest} push --sign-by-sigstore=param-file.yaml)
(podman push) and (podman manifest push) now support --sign-by-sigstore=param-file, using the containers-sigstore-signing-params.yaml(5) file format. That notably adds support for Fulcio and Rekor signing. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
		
							
								
								
									
										48
									
								
								vendor/github.com/hashicorp/go-cleanhttp/handlers.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								vendor/github.com/hashicorp/go-cleanhttp/handlers.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,48 @@ | ||||
| package cleanhttp | ||||
|  | ||||
| import ( | ||||
| 	"net/http" | ||||
| 	"strings" | ||||
| 	"unicode" | ||||
| ) | ||||
|  | ||||
| // HandlerInput provides input options to cleanhttp's handlers | ||||
| type HandlerInput struct { | ||||
| 	ErrStatus int | ||||
| } | ||||
|  | ||||
| // PrintablePathCheckHandler is a middleware that ensures the request path | ||||
| // contains only printable runes. | ||||
| func PrintablePathCheckHandler(next http.Handler, input *HandlerInput) http.Handler { | ||||
| 	// Nil-check on input to make it optional | ||||
| 	if input == nil { | ||||
| 		input = &HandlerInput{ | ||||
| 			ErrStatus: http.StatusBadRequest, | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	// Default to http.StatusBadRequest on error | ||||
| 	if input.ErrStatus == 0 { | ||||
| 		input.ErrStatus = http.StatusBadRequest | ||||
| 	} | ||||
|  | ||||
| 	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||||
| 		if r != nil { | ||||
| 			// Check URL path for non-printable characters | ||||
| 			idx := strings.IndexFunc(r.URL.Path, func(c rune) bool { | ||||
| 				return !unicode.IsPrint(c) | ||||
| 			}) | ||||
|  | ||||
| 			if idx != -1 { | ||||
| 				w.WriteHeader(input.ErrStatus) | ||||
| 				return | ||||
| 			} | ||||
|  | ||||
| 			if next != nil { | ||||
| 				next.ServeHTTP(w, r) | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		return | ||||
| 	}) | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Miloslav Trmač
					Miloslav Trmač