api: fix 401 responses which should be 403s
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
		| @ -62,6 +62,3 @@ class AuthentikTokenAuthentication(BaseAuthentication): | |||||||
|             return None |             return None | ||||||
|  |  | ||||||
|         return (token.user, None) |         return (token.user, None) | ||||||
|  |  | ||||||
|     def authenticate_header(self, request: Request) -> str: |  | ||||||
|         return "Bearer" |  | ||||||
|  | |||||||
| @ -4,6 +4,7 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"math/rand" | 	"math/rand" | ||||||
| 	"net/url" | 	"net/url" | ||||||
|  | 	"os" | ||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
| 	"github.com/go-openapi/runtime" | 	"github.com/go-openapi/runtime" | ||||||
| @ -56,7 +57,8 @@ func NewAPIController(akURL url.URL, token string) *APIController { | |||||||
| 	outposts, err := apiClient.Outposts.OutpostsInstancesList(outposts.NewOutpostsInstancesListParams(), auth) | 	outposts, err := apiClient.Outposts.OutpostsInstancesList(outposts.NewOutpostsInstancesListParams(), auth) | ||||||
|  |  | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.WithError(err).Panic("Failed to fetch configuration") | 		log.WithError(err).Error("Failed to fetch configuration") | ||||||
|  | 		os.Exit(1) | ||||||
| 	} | 	} | ||||||
| 	outpost := outposts.Payload.Results[0] | 	outpost := outposts.Payload.Results[0] | ||||||
| 	doGlobalSetup(outpost.Config.(map[string]interface{})) | 	doGlobalSetup(outpost.Config.(map[string]interface{})) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer