|
14 | 14 |
|
15 | 15 | package org.eclipse.edc.issuerservice.publisher;
|
16 | 16 |
|
17 |
| -import com.fasterxml.jackson.databind.ObjectMapper; |
18 | 17 | import org.eclipse.edc.identityhub.spi.verifiablecredentials.store.CredentialStore;
|
19 | 18 | import org.eclipse.edc.issuerservice.publisher.api.StatusListCredentialController;
|
20 | 19 | import org.eclipse.edc.issuerservice.spi.credentials.statuslist.StatusListCredentialPublisher;
|
|
24 | 23 | import org.eclipse.edc.runtime.metamodel.annotation.Provider;
|
25 | 24 | import org.eclipse.edc.runtime.metamodel.annotation.Setting;
|
26 | 25 | import org.eclipse.edc.runtime.metamodel.annotation.Settings;
|
| 26 | +import org.eclipse.edc.spi.monitor.Monitor; |
27 | 27 | import org.eclipse.edc.spi.system.Hostname;
|
28 | 28 | import org.eclipse.edc.spi.system.ServiceExtension;
|
29 | 29 | import org.eclipse.edc.spi.system.ServiceExtensionContext;
|
| 30 | +import org.eclipse.edc.spi.types.TypeManager; |
30 | 31 | import org.eclipse.edc.transaction.spi.TransactionContext;
|
31 | 32 | import org.eclipse.edc.web.spi.WebService;
|
32 | 33 | import org.eclipse.edc.web.spi.configuration.PortMapping;
|
33 | 34 | import org.eclipse.edc.web.spi.configuration.PortMappingRegistry;
|
34 | 35 | import org.jetbrains.annotations.NotNull;
|
35 | 36 |
|
36 | 37 | import static java.util.Optional.ofNullable;
|
| 38 | +import static org.eclipse.edc.spi.constants.CoreConstants.JSON_LD; |
37 | 39 |
|
38 | 40 |
|
39 | 41 | @Extension(value = LocalStatusListCredentialPublisherExtension.NAME)
|
40 | 42 | public class LocalStatusListCredentialPublisherExtension implements ServiceExtension {
|
41 | 43 | public static final String NAME = "IssuerService Default Services Extension";
|
42 | 44 | private static final String STATUS_LIST = "statuslist";
|
| 45 | + |
43 | 46 | @Inject
|
44 | 47 | private CredentialStore store;
|
45 | 48 |
|
46 | 49 | @Inject
|
47 | 50 | private PortMappingRegistry portMappingRegistry;
|
| 51 | + |
48 | 52 | @Inject
|
49 | 53 | private Hostname hostname;
|
50 | 54 |
|
51 | 55 | @Inject
|
52 | 56 | private WebService webServer;
|
53 | 57 |
|
| 58 | + @Inject |
| 59 | + private Monitor monitor; |
| 60 | + |
| 61 | + @Inject |
| 62 | + private TypeManager typeManager; |
| 63 | + |
54 | 64 | @Configuration
|
55 | 65 | private StatusListCredentialEndpointConfig config;
|
56 | 66 | @Inject
|
57 | 67 | private TransactionContext transactionContext;
|
| 68 | + @Setting(description = "Configures endpoint for reaching the StatusList API.", key = "edc.statuslist.callback.address", required = false) |
| 69 | + private String callbackAddress; |
58 | 70 |
|
59 | 71 | @Override
|
60 | 72 | public String name() {
|
61 | 73 | return NAME;
|
62 | 74 | }
|
63 | 75 |
|
64 |
| - @Setting(description = "Configures endpoint for reaching the StatusList API.", key = "edc.statuslist.callback.address", required = false) |
65 |
| - private String callbackAddress; |
66 |
| - |
67 | 76 | @Override
|
68 | 77 | public void initialize(ServiceExtensionContext context) {
|
69 | 78 | portMappingRegistry.register(new PortMapping(STATUS_LIST, config.port(), config.path()));
|
70 | 79 |
|
71 |
| - webServer.registerResource(STATUS_LIST, new StatusListCredentialController(store, context.getMonitor(), new ObjectMapper())); |
| 80 | + webServer.registerResource(STATUS_LIST, new StatusListCredentialController(store, monitor, () -> typeManager.getMapper(JSON_LD))); |
72 | 81 | }
|
73 | 82 |
|
74 | 83 | @Provider(isDefault = true)
|
|
0 commit comments