You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
excerpt: "A silent bug in Django Rest Framework caused my API to return 403 instead of 401. The culprit? Authentication class order. Here's what I discovered deep in the source."
@@ -43,8 +43,6 @@ When authentication fails, DRF must return either a **401 Unauthorized** or **40
43
43
44
44
If no class provides a header-that is, if all return `None`-DRF defaults to 403. Otherwise, it returns 401.
45
45
46
-
---
47
-
48
46
## This Is Known-and Here’s Why (but I Still Think It’s a Bug)
49
47
50
48
DRF documentation clearly states:
@@ -61,8 +59,6 @@ Because DRF uses the **first** authenticator’s header presence to decide statu
61
59
62
60
The rationale: session first → no header → 403; token-first → header present → 401.
63
61
64
-
---
65
-
66
62
# My Setup
67
63
68
64
I had this configuration:
@@ -75,7 +71,7 @@ REST_FRAMEWORK = {
75
71
myapp.authentication.BearerAuthentication,
76
72
)
77
73
}
78
-
````
74
+
```
79
75
80
76
My `BearerAuthentication` inherits from `BaseAuthentication` and returns `"Bearer"` in `authenticate_header()`.
81
77
@@ -131,8 +127,6 @@ Importantly, returning the `WWW-Authenticate` header of the **class that raised*
131
127
132
128
In contrast, DRF’s current approach-relying on the first listed authenticator-can lead to misleading 403 responses when a later scheme actually fails.
133
129
134
-
---
135
-
136
130
## Proposed Fix and Upcoming PR
137
131
138
132
I plan to open a pull request addressing issue #3800 with:
excerpt: "Kubix is a Rust-powered CLI wrapper around kubectl that simplifies your Kubernetes workflow with smart aliases and powerful UX."
@@ -34,84 +34,77 @@ Kubix is a smart CLI wrapper around `kubectl`, written in *Rust*, that helps you
34
34
35
35
I wanted to learn Rust. I also wanted to streamline my everyday work with `kubectl`, which often involves typing long repetitive commands and switching contexts or namespaces.
36
36
37
-
Sure, there are existing scripts and even tools like `kubectl ai`, but building *yet another wrapper* gave me the hands-on experience I needed, and a way to tailor the tool exactly to how I work. No better way to learn a language than solving a problem you care about.
37
+
Sure, there are existing wrappers or scripts and even tools like `kubectl ai`, but building *yet another wrapper* gave me the hands-on experience I needed, and a way to tailor the tool exactly to how I work. No better way to learn a language than solving a problem you care about.
38
38
39
39
## What Kubix Does
40
40
41
41
Kubix acts as a shortcut layer on top of `kubectl`. It offers:
42
42
43
-
-**Faster, cleaner commands** for common tasks (e.g., `kubix pods` instead of `kubectl get pods`)
43
+
-**Faster, cleaner commands** for common tasks (e.g., `kubix pods pattern` instead of `kubectl get pods | grep pattern`)
44
44
-**Context-aware behavior** for easier switching between clusters and namespaces
45
-
-**Aliased commands** for logs, exec, describe, delete, and more
45
+
-**Aliased commands** for logs, and pods (e.g., `kubix pods`and `kubix pod` will work the same!)
46
46
-**Powerful CLI UX** thanks to Rust's blazing performance and the [`clap`](https://docs.rs/clap/latest/clap/) framework
47
-
-**Extensibility** - future support planned for fuzzy search, natural language (LLM) inputs, and command history
47
+
-**Extensibility** - future support planned for additonal fuzzy search, natural language (LLM) inputs, and command history
48
48
49
49
Here’s a taste:
50
50
51
51
```bash
52
-
# List all pods
53
-
kubix pods
52
+
# List all pods in the testing context
53
+
kubix pods -c testing
54
54
55
-
#Execute into a pod
55
+
#Bash into a pod with pattern my-app
56
56
kubix exec my-app
57
57
58
-
# View logs
59
-
kubix logs my-app
58
+
# View the last 10 logs from that pod
59
+
kubix logs my-app -t 10
60
60
```
61
61
62
+
---
63
+
62
64
### Beautiful CLI Output (Yes, It Sparks Joy)
63
65
64
66
Kubix isn’t just fast - it’s also pleasant to use.
65
67
66
68
Using the excellent [`tabled`](https://docs.rs/tabled/) crate, Kubix formats Kubernetes objects (like pods, contexts, etc.) into clean, readable tables that make your terminal feel more like a dashboard.
There’s also interactive selection using pattern matching and fuzzy input.
80
81
81
82
```bash
82
-
kubix exec
83
+
kubix ctx tesing
83
84
```
84
85
85
-
This command will show a numbered list of pods matching your query, and let you select one easily by number or name:
86
-
87
-
```text
88
-
Which pod do you want to exec into?
86
+
This command will show a numbered list of contexts matching your query, and let you select one easily by number, it works for pods and namespaces as well:
0 commit comments