mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-01 02:57:59 +00:00 
			
		
		
		
	Replace http method strings with net/http constants (#14677)
This commit is contained in:
		 Anton Averchenkov
					Anton Averchenkov
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							7f36a29e04
						
					
				
				
					commit
					0dd4cda7c9
				
			| @@ -4,6 +4,7 @@ import ( | ||||
| 	"context" | ||||
| 	"errors" | ||||
| 	"fmt" | ||||
| 	"net/http" | ||||
|  | ||||
| 	"github.com/mitchellh/mapstructure" | ||||
| ) | ||||
| @@ -16,7 +17,7 @@ func (c *Sys) ListAuthWithContext(ctx context.Context) (map[string]*AuthMount, e | ||||
| 	ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) | ||||
| 	defer cancelFunc() | ||||
|  | ||||
| 	r := c.c.NewRequest("GET", "/v1/sys/auth") | ||||
| 	r := c.c.NewRequest(http.MethodGet, "/v1/sys/auth") | ||||
|  | ||||
| 	resp, err := c.c.rawRequestWithContext(ctx, r) | ||||
| 	if err != nil { | ||||
| @@ -57,7 +58,7 @@ func (c *Sys) EnableAuthWithOptionsWithContext(ctx context.Context, path string, | ||||
| 	ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) | ||||
| 	defer cancelFunc() | ||||
|  | ||||
| 	r := c.c.NewRequest("POST", fmt.Sprintf("/v1/sys/auth/%s", path)) | ||||
| 	r := c.c.NewRequest(http.MethodPost, fmt.Sprintf("/v1/sys/auth/%s", path)) | ||||
| 	if err := r.SetJSONBody(options); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| @@ -79,7 +80,7 @@ func (c *Sys) DisableAuthWithContext(ctx context.Context, path string) error { | ||||
| 	ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) | ||||
| 	defer cancelFunc() | ||||
|  | ||||
| 	r := c.c.NewRequest("DELETE", fmt.Sprintf("/v1/sys/auth/%s", path)) | ||||
| 	r := c.c.NewRequest(http.MethodDelete, fmt.Sprintf("/v1/sys/auth/%s", path)) | ||||
|  | ||||
| 	resp, err := c.c.rawRequestWithContext(ctx, r) | ||||
| 	if err == nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user