Commit b4b41b0
committed
GROOVY-12270: Map connector authentication properties onto the keys a connector consumes
JmxBuilder's connectorServer documents properties:[authenticate:true,
passwordFile:..., accessFile:...], and wrote them into the connector
environment under com.sun.management.jmxremote.* names. Those names belong
to the JDK's out-of-the-box management agent, not to a connector server.
The agent reads them and translates them into the jmx.remote.x.* names the
connector actually consumes, then installs the authenticator itself; see
sun.management.jmxremote.ConnectorBootstrap. Nothing performed that
translation here, so an operator following the documented syntax started a
connector with no authenticator at all.
Verified rather than reasoned: with the environment this class built, the
connector reported no authenticator and a credential-less client connected
and read the MBean count; with jmx.remote.x.password.file the same client
is rejected with "Authentication failed! Credentials required".
Translate the aliases, and only when authentication was requested. Add
loginConfig for JAAS, mapping to jmx.remote.x.login.config. Reject
authenticate:true with no source of credentials at all, since that asks for
authentication and would otherwise start open, which is the failure being
fixed; a caller-supplied jmx.remote.authenticator counts as such a source,
since passing a JMXAuthenticator through is the standard JSR-160 route for
custom authentication.
The com.sun.management.jmxremote.* names remain accepted as input spellings
but are no longer copied into the environment, where they mean nothing;
the ssl alias is likewise consumed to select the socket factories rather
than passed through. Three GROOVY-12119 tests asserted the presence of
those inert keys as a witness that the environment map was not discarded;
they now assert the effective configuration instead, which is what their
comments describe.
Note on urgency rather than severity: no released version has ever passed
the property map to the connector, because the building method returned
null until GROOVY-12119, which is in no GA release. There is therefore no
installed base of connectors that believe they are authenticated. What
makes this worth fixing before GA is that GROOVY-12119 leaves SSL working
while authentication silently does not, which is a quieter failure than the
wholly broken configuration it replaced.
The default remains an unauthenticated connector when no authentication is
requested. Warning on that is a separate question from this one.1 parent 34ed575 commit b4b41b0
2 files changed
Lines changed: 152 additions & 9 deletions
File tree
- subprojects/groovy-jmx/src
- main/groovy/groovy/jmx/builder
- test/groovy/groovy/jmx/builder
Lines changed: 33 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
| |||
149 | 158 | | |
150 | 159 | | |
151 | 160 | | |
152 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
153 | 167 | | |
154 | | - | |
155 | 168 | | |
156 | | - | |
157 | 169 | | |
158 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
159 | 188 | | |
160 | 189 | | |
161 | 190 | | |
162 | | - | |
163 | 191 | | |
164 | 192 | | |
165 | 193 | | |
| |||
Lines changed: 119 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
51 | 162 | | |
52 | 163 | | |
53 | 164 | | |
| |||
81 | 192 | | |
82 | 193 | | |
83 | 194 | | |
84 | | - | |
85 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
86 | 200 | | |
87 | 201 | | |
88 | 202 | | |
| |||
92 | 206 | | |
93 | 207 | | |
94 | 208 | | |
95 | | - | |
| 209 | + | |
| 210 | + | |
96 | 211 | | |
97 | 212 | | |
98 | 213 | | |
| |||
127 | 242 | | |
128 | 243 | | |
129 | 244 | | |
130 | | - | |
| 245 | + | |
131 | 246 | | |
132 | 247 | | |
133 | 248 | | |
| |||
0 commit comments