Commit cf5d375
Cure HTTP Authentication Singleton's Password Overwrite (OneCricketeer#19)
* Enable Service Provider Relocation (OneCricketeer#17) (OneCricketeer#4)
Schema Registry Client's basic HTTP Authentication support is
implemented through a ServiceProvider. Without handling the fact that
relocating the schema client also relocates the service implementations,
no implementations are found when the client attempts to find a strategy
that matches an authentication source type specified through
basic.auth.credentials.source...
* Improve test cases that distinguish between source and destination credentials
-- Split credentials fixture value pair into two distinct value pairs,
one for source registry clients, another for destinations.
-- Add test case verifying source authentication properties reach source
registry client
-- Add test case verifying destination authentication properties reach
destination registry client
-- Add test cases verifying expected exception when incorrect
credentials are passed to source and/or destination registry client.
-- Add test case using distinct credentials for both source and
destination in same execution and using same authentication source
strategy (currently does not pass!)
* Compensate for Basic HTTP Authentication's Singleton Implementation
The fact that Basic HTTP Authentication as implemented in the Kafka
Connect Client uses a singleton to hold configured credentials means
that if both the source and destination schema registries require basic
HTTP authentication and want to provide credentials via
`basic.auth.credentials.source`, the second set of credentials will
overwrite and replace the first`
Connect's three singletons for Basic HTTP Authentication are selected by
the same three key values used in `basic.auth.credentials.source` to
designate which represented algorithm to use.
This commit begins compensating for these singletons first by creating
and registering two additional copies of the Basic Auth singletons in
the SMT's code base. One is intended for use by the source broker's
schema registry client, the other is for destinaation broker's registry.
The only intentional difference between what is built here and the
production Kafka Connect namespac is the addition of a short prefix to
distinguish `SRC_` from `DEST_`.
Now, when removing a prefix it uses to broker input to one adapter or
the orther, in addition to selecting which configuration hash
destrination to use, it also adds that prefix to the value it provides
for `basic.auth.credentials.source`. As a result, the source and
destination schema registry clients will each now use a diffent
singleton to hold onto their credentials with two distinct singletons.
This work relies on addition of ServicesRouterTransformer to he maven
shade plugin that was recently reviewd and released.1 parent 8b76edb commit cf5d375
File tree
11 files changed
+120
-12
lines changed- src
- main
- java/cricket/jmoore
- kafka/connect/transforms
- security/basicauth
- resources/META-INF/services
- test/java/cricket/jmoore/kafka/connect/transforms
11 files changed
+120
-12
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| 127 | + | |
| 128 | + | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| |||
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
136 | | - | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| |||
0 commit comments