|
52 | 52 | import org.eclipse.basyx.components.security.authorization.internal.IJwtBearerTokenAuthenticationConfigurationProvider; |
53 | 53 | import org.eclipse.basyx.extensions.aas.directory.tagged.api.IAASTaggedDirectory; |
54 | 54 | import org.eclipse.basyx.extensions.aas.directory.tagged.map.MapTaggedDirectory; |
| 55 | +import org.eclipse.basyx.extensions.shared.authorization.internal.ElevatedCodeAuthentication; |
55 | 56 | import org.eclipse.basyx.extensions.shared.encoding.Base64URLEncoder; |
56 | 57 | import org.eclipse.basyx.extensions.shared.encoding.URLEncoder; |
57 | 58 | import org.eclipse.basyx.vab.protocol.http.server.BaSyxContext; |
@@ -263,7 +264,9 @@ private HttpServlet createTaggedRegistryServlet() { |
263 | 264 | logger.info("Enable tagged directory functionality"); |
264 | 265 | IAASTaggedDirectory taggedDirectory; |
265 | 266 | if (registryConfig.getRegistryBackend().equals(RegistryBackend.MONGODB)) { |
266 | | - taggedDirectory = new MongoDBTaggedDirectory(loadMongoDBConfiguration(), new HashMap<>()); |
| 267 | + try (final var ignored = ElevatedCodeAuthentication.enterElevatedCodeAuthenticationArea()) { |
| 268 | + taggedDirectory = new MongoDBTaggedDirectory(loadMongoDBConfiguration(), new HashMap<>()); |
| 269 | + } |
267 | 270 | } else { |
268 | 271 | taggedDirectory = new MapTaggedDirectory(new HashedMap<>(), new HashedMap<>()); |
269 | 272 | } |
@@ -336,7 +339,9 @@ private IAASRegistry createSQLRegistryBackend() { |
336 | 339 | private IAASRegistry createMongoDBRegistryBackend() { |
337 | 340 | logger.info("Creating MongoDBRegistry"); |
338 | 341 | final BaSyxMongoDBConfiguration mongoDBConfiguration = loadMongoDBConfiguration(); |
339 | | - return new MongoDBRegistry(mongoDBConfiguration); |
| 342 | + try (final var ignored = ElevatedCodeAuthentication.enterElevatedCodeAuthenticationArea()) { |
| 343 | + return new MongoDBRegistry(mongoDBConfiguration); |
| 344 | + } |
340 | 345 | } |
341 | 346 |
|
342 | 347 | private IAASRegistry decorate(IAASRegistry aasRegistry) { |
|
0 commit comments