Skip to content

Commit 71dc994

Browse files
committed
fix(authorization)!: remove unused keycloak based authorization
1 parent ff08972 commit 71dc994

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

authorization/src/main/kotlin/org/modelix/authorization/AuthorizationConfig.kt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,7 @@ class ModelixAuthorizationConfig : IModelixAuthorizationConfig {
114114
override var hmac256Key: String? = null
115115
override var ownPublicKey: JWK? = null
116116
private val foreignPublicKeys = ArrayList<JWK>()
117-
override var jwkUri: URI? = System.getenv("MODELIX_JWK_URI")?.let { URI(it) }
118-
?: System.getenv("KEYCLOAK_BASE_URL")?.let { keycloakBaseUrl ->
119-
System.getenv("KEYCLOAK_REALM")?.let { keycloakRealm ->
120-
URI("${keycloakBaseUrl}realms/$keycloakRealm/protocol/openid-connect/certs")
121-
}
122-
}
117+
override var jwkUri: URI? = null
123118
override var jwkKeyId: String? = System.getenv("MODELIX_JWK_KEY_ID")
124119
override var permissionSchema: Schema = buildPermissionSchema { }
125120
override var accessControlPersistence: IAccessControlPersistence = System.getenv("MODELIX_ACCESS_CONTROL_FILE")
@@ -156,10 +151,6 @@ class ModelixAuthorizationConfig : IModelixAuthorizationConfig {
156151

157152
jwkUri?.let { util.addJwksUrl(it.toURL()) }
158153

159-
// allows multiple URLs (MODELIX_JWK_URI1, MODELIX_JWK_URI2, MODELIX_JWK_URI_MODEL_SERVER, ...)
160-
System.getenv().filter { it.key.startsWith("MODELIX_JWK_URI") }.values
161-
.forEach { util.addJwksUrl(URI(it).toURL()) }
162-
163154
foreignPublicKeys.forEach { util.addPublicKey(it) }
164155

165156
jwkKeyId?.let { util.requireKeyId(it) }

authorization/src/main/kotlin/org/modelix/authorization/ModelixJWTUtil.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ class ModelixJWTUtil {
120120
}
121121
}
122122
}
123+
124+
// allows multiple URLs (MODELIX_JWK_URI1, MODELIX_JWK_URI2, MODELIX_JWK_URI_MODEL_SERVER, ...)
125+
System.getenv().filter { it.key.startsWith("MODELIX_JWK_URI") }.values
126+
.forEach { addJwksUrl(URI(it).toURL()) }
123127
}
124128

125129
fun createAccessToken(user: String, grantedPermissions: List<String>, additionalTokenContent: (TokenBuilder) -> Unit = {}): String {

docs/global/modules/core/pages/reference/component-model-server.adoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ To enable it you can specify the following environment variables.
8585
|MODELIX_JWK_KEY_ID
8686
|Optional key ID that can be used together with `MODELIX_JWK_URI`. If specified, it ensures that only tokens that use the specified key are valid. If not specified, a token can use any RSA (256, 384 and 512) key provided by `MODELIX_JWK_URI`.
8787

88-
|KEYCLOAK_BASE_URL
89-
KEYCLOAK_REALM
90-
|Legacy variables for the keycloak based authorization used by the Modelix Helm charts for workspaces.
91-
9288
|===
9389

9490
The `permissions` claim of the token is expected to list directly granted permission.

0 commit comments

Comments
 (0)