File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
authorization/src/main/kotlin/org/modelix/authorization Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -85,16 +85,22 @@ interface IModelixAuthorizationConfig {
85
85
var jwkUri: URI ?
86
86
87
87
/* *
88
- * The ID of the public key for the RSA signature .
88
+ * If set, only this key is allowed to sign tokens, even if the jwkUri provides multiple keys .
89
89
*/
90
- @Deprecated(" The key ID is supposed to be retrieved from the token " )
90
+ @Deprecated(" Untrusted keys shouldn't even be return by the jwkUri or configured in some other way " )
91
91
var jwkKeyId: String?
92
92
93
93
/* *
94
94
* Defines the available permissions and their relations.
95
95
*/
96
96
var permissionSchema: Schema
97
97
98
+ /* *
99
+ * Via /permissions/manage, users can grant permissions to ID tokens.
100
+ * By default, changes are not persisted.
101
+ * As an alternative to this configuration option, the environment variable MODELIX_ACCESS_CONTROL_FILE can be used
102
+ * to write changes to disk.
103
+ */
98
104
var accessControlPersistence: IAccessControlPersistence
99
105
100
106
/* *
@@ -213,7 +219,7 @@ private fun getBooleanFromEnv(name: String): Boolean? {
213
219
214
220
internal fun ByteArray.repeatBytes (minimumSize : Int ): ByteArray {
215
221
if (size >= minimumSize) return this
216
- val repeated = ByteArray (((size / 256 ) + 1 ) * 256 )
222
+ val repeated = ByteArray (minimumSize )
217
223
for (i in repeated.indices) repeated[i] = this [i % size]
218
224
return repeated
219
225
}
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ class ModelixJWTUtil {
87
87
}
88
88
89
89
fun addHmacKey (key : String , algorithm : JWSAlgorithm ) {
90
+ // nimbusds checks for weak keys that are shorter than 256 bytes
90
91
addHmacKey(key.toByteArray().ensureMinSecretLength(algorithm), algorithm)
91
92
}
92
93
You can’t perform that action at this time.
0 commit comments