-
Notifications
You must be signed in to change notification settings - Fork 168
Introduce VC Management APIs #1035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3b54bde
add vc mgt api
shashimalcse fbe0007
add vc mgt api
shashimalcse 9e9dc11
add vc mgt api v2
shashimalcse 219c08a
change vc api contract
shashimalcse 8542947
update pom
shashimalcse f947df3
update api spec
shashimalcse af8cff8
update api spec
shashimalcse 6cc95c3
update api spec
shashimalcse 8b46f92
add vc resource type
shashimalcse 740b4b6
fix licence header
shashimalcse ba06223
fix offer id
shashimalcse 523567b
remove offer endpoint
shashimalcse ba20062
fix offer id not returned
shashimalcse 1f5266f
Add pagination
shashimalcse c048b63
update vc mgt component path
shashimalcse 310c112
fix modole name chnages
shashimalcse 88b5701
update vc template api endpoint
shashimalcse 984a9f8
improve error handling
shashimalcse 042b1f6
update framework and oid4vc version
shashimalcse 95c52d0
fix licence header
shashimalcse 48f6e9b
update version of vc
shashimalcse 5d91ae7
fix error code for limit validation
shashimalcse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...late.management/org.wso2.carbon.identity.api.server.vc.template.management.common/pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). | ||
| ~ | ||
| ~ WSO2 LLC. licenses this file to you under the Apache License, | ||
| ~ Version 2.0 (the "License"); you may not use this file except | ||
| ~ in compliance with the License. | ||
| ~ You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, | ||
| ~ software distributed under the License is distributed on an | ||
| ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| ~ KIND, either express or implied. See the License for the | ||
| ~ specific language governing permissions and limitations | ||
| ~ under the License. | ||
| --> | ||
|
|
||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>org.wso2.carbon.identity.server.api</groupId> | ||
| <artifactId>org.wso2.carbon.identity.api.server.vc.template.management</artifactId> | ||
| <version>1.3.228-SNAPSHOT</version> | ||
| <relativePath>../pom.xml</relativePath> | ||
| </parent> | ||
|
|
||
| <artifactId>org.wso2.carbon.identity.api.server.vc.template.management.common</artifactId> | ||
| <packaging>jar</packaging> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <configuration> | ||
| <source>1.8</source> | ||
| <target>1.8</target> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>javax.ws.rs</groupId> | ||
| <artifactId>javax.ws.rs-api</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.wso2.carbon.identity.openid4vc</groupId> | ||
| <artifactId>org.wso2.carbon.identity.openid4vc.template.management</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> | ||
|
|
97 changes: 97 additions & 0 deletions
97
...rbon/identity/api/server/vc/template/management/common/VCTemplateManagementConstants.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| /* | ||
| * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). | ||
| * | ||
| * WSO2 LLC. licenses this file to you under the Apache License, | ||
| * Version 2.0 (the "License"); you may not use this file except | ||
| * in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.wso2.carbon.identity.api.server.vc.template.management.common; | ||
|
|
||
| /** | ||
| * Constants related to VC template management. | ||
| */ | ||
| public final class VCTemplateManagementConstants { | ||
|
|
||
| private VCTemplateManagementConstants() { | ||
|
|
||
| } | ||
|
|
||
| public static final String VC_TEMPLATE_PATH_COMPONENT = "vc-templates"; | ||
| public static final String PATH_SEPARATOR = "/"; | ||
| public static final Integer DEFAULT_LIMIT = 10; | ||
| public static final String ASC_SORT_ORDER = "ASC"; | ||
| public static final String DESC_SORT_ORDER = "DESC"; | ||
|
|
||
| /** | ||
| * Error message codes and default messages used in VC config management. | ||
| */ | ||
| public enum ErrorMessages { | ||
| // Client errors | ||
| ERROR_CODE_TEMPLATE_ID_MISMATCH("VCM-60001", "Template id path and payload mismatch.", | ||
| "Template id in the path does not match the id in the request payload."), | ||
| ERROR_CODE_IDENTIFIER_ALREADY_EXISTS("VCM-60002", "Template with the same identifier already exists.", | ||
| "A verifiable credential template with the provided identifier already exists in the system."), | ||
| ERROR_CODE_EMPTY_FIELD("VCM-60003", "Invalid request.", | ||
| "%s cannot be empty."), | ||
| ERROR_CODE_INVALID_FIELD("VCM-60004", "Invalid request.", | ||
| "%s is invalid."), | ||
| ERROR_CODE_TEMPLATE_NOT_FOUND("VCM-60005", "Template not found.", | ||
| "Verifiable credential template with the given identifier does not exist."), | ||
| ERROR_CODE_UNSUPPORTED_VC_FORMAT("VCM-60006", "Unsupported verifiable credential format.", | ||
| "The specified verifiable credential format is not supported."), | ||
| ERROR_CODE_OFFER_NOT_FOUND("VCM-60007", "Offer not found.", | ||
| "Credential offer for the specified template does not exist."), | ||
| ERROR_CODE_INVALID_EXPIRY("VCM-60008", "Invalid expiry value.", | ||
| "Expiry must be at least %d seconds."), | ||
| ERROR_CODE_INVALID_CLAIM("VCM-60009", "Invalid claim.", | ||
| "Invalid claim: %s"), | ||
| ERROR_CODE_INVALID_QUERY_PARAM("VCM-60010", "Invalid query parameter.", | ||
| "Invalid query parameter : %s"), | ||
|
|
||
| // Server errors | ||
| ERROR_CODE_PERSISTENCE_ERROR("VCM-65001", "Error while persisting template.", | ||
| "An error occurred while storing the verifiable credential template in the database."), | ||
| ERROR_CODE_RETRIEVAL_ERROR("VCM-65002", "Error while retrieving template.", | ||
| "An error occurred while fetching the verifiable credential template from the database."), | ||
| ERROR_CODE_DELETION_ERROR("VCM-65003", "Error while deleting template.", | ||
| "An error occurred while removing the verifiable credential template from the database."), | ||
| ERROR_CODE_TRANSACTION_ERROR("VCM-65004", "Error in database transaction.", | ||
| "A database transaction error occurred while processing the verifiable credential template."), | ||
| ERROR_CODE_CLAIM_VALIDATION_ERROR("VCM-65005", "Error while validating claims.", | ||
| "Error while validating claims."); | ||
|
|
||
| private final String code; | ||
| private final String message; | ||
| private final String description; | ||
|
|
||
| ErrorMessages(String code, String message, String description) { | ||
| this.code = code; | ||
| this.message = message; | ||
| this.description = description; | ||
| } | ||
|
|
||
| public String getCode() { | ||
| return code; | ||
| } | ||
|
|
||
| public String getMessage() { | ||
| return message; | ||
| } | ||
|
|
||
| public String getDescription() { | ||
| return description; | ||
| } | ||
| } | ||
| } | ||
|
|
48 changes: 48 additions & 0 deletions
48
.../identity/api/server/vc/template/management/common/VCTemplateManagementServiceHolder.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /* | ||
| * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). | ||
| * | ||
| * WSO2 LLC. licenses this file to you under the Apache License, | ||
| * Version 2.0 (the "License"); you may not use this file except | ||
| * in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.wso2.carbon.identity.api.server.vc.template.management.common; | ||
|
|
||
| import org.wso2.carbon.context.PrivilegedCarbonContext; | ||
| import org.wso2.carbon.identity.openid4vc.template.management.VCTemplateManager; | ||
|
|
||
| /** | ||
| * Service holder for {@link VCTemplateManager} OSGi service. | ||
| */ | ||
| public final class VCTemplateManagementServiceHolder { | ||
|
|
||
| private VCTemplateManagementServiceHolder() { | ||
| } | ||
|
|
||
| private static class ServiceHolder { | ||
|
|
||
| static final VCTemplateManager TEMPLATE_SERVICE = (VCTemplateManager) PrivilegedCarbonContext | ||
| .getThreadLocalCarbonContext().getOSGiService(VCTemplateManager.class, null); | ||
|
|
||
| } | ||
|
|
||
| /** | ||
| * Get the {@link VCTemplateManager} OSGi service. | ||
| * | ||
| * @return The VCTemplateManager service instance. | ||
| */ | ||
| public static VCTemplateManager getVCTemplateManager() { | ||
|
|
||
| return ServiceHolder.TEMPLATE_SERVICE; | ||
shashimalcse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
166 changes: 166 additions & 0 deletions
166
...template.management/org.wso2.carbon.identity.api.server.vc.template.management.v1/pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). | ||
| ~ | ||
| ~ WSO2 LLC. licenses this file to you under the Apache License, | ||
| ~ Version 2.0 (the "License"); you may not use this file except | ||
| ~ in compliance with the License. | ||
| ~ You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, | ||
| ~ software distributed under the License is distributed on an | ||
| ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| ~ KIND, either express or implied. See the License for the | ||
| ~ specific language governing permissions and limitations | ||
| ~ under the License. | ||
| --> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>org.wso2.carbon.identity.server.api</groupId> | ||
| <artifactId>org.wso2.carbon.identity.api.server.vc.template.management</artifactId> | ||
| <version>1.3.228-SNAPSHOT</version> | ||
| <relativePath>../pom.xml</relativePath> | ||
| </parent> | ||
|
|
||
| <name>WSO2 Identity Server - VC Config Management API</name> | ||
| <description>WSO2 IS - Verifiable Credential Configuration Management API</description> | ||
| <artifactId>org.wso2.carbon.identity.api.server.vc.template.management.v1</artifactId> | ||
shashimalcse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <packaging>jar</packaging> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.fasterxml.jackson.jaxrs</groupId> | ||
| <artifactId>jackson-jaxrs-json-provider</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.cxf</groupId> | ||
| <artifactId>cxf-rt-frontend-jaxrs</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>javax.ws.rs</groupId> | ||
| <artifactId>javax.ws.rs-api</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.swagger</groupId> | ||
| <artifactId>swagger-jaxrs</artifactId> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-databind</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-annotations</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>com.fasterxml.jackson.core</groupId> | ||
| <artifactId>jackson-core</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>com.fasterxml.jackson.dataformat</groupId> | ||
| <artifactId>jackson-dataformat-yaml</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>javax.ws.rs</groupId> | ||
| <artifactId>jsr311-api</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>guava</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.wso2.carbon.identity.server.api</groupId> | ||
| <artifactId>org.wso2.carbon.identity.api.server.common</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.wso2.carbon.identity.openid4vc</groupId> | ||
| <artifactId>org.wso2.carbon.identity.openid4vc.template.management</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.wso2.carbon.identity.server.api</groupId> | ||
| <artifactId>org.wso2.carbon.identity.api.server.vc.template.management.common</artifactId> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <version>${maven.compiler.plugin.version}</version> | ||
| <configuration> | ||
| <source>1.8</source> | ||
| <target>1.8</target> | ||
shashimalcse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </configuration> | ||
| </plugin> | ||
| <!--This plugin is used to generate the API classes from the OpenAPI definition.--> | ||
| <!--Uncomment and execute if the API is updated.--> | ||
| <!-- <plugin>--> | ||
| <!-- <groupId>org.openapitools</groupId>--> | ||
| <!-- <artifactId>openapi-generator-maven-plugin</artifactId>--> | ||
| <!-- <version>4.1.2</version>--> | ||
| <!-- <executions>--> | ||
| <!-- <execution>--> | ||
| <!-- <goals>--> | ||
| <!-- <goal>generate</goal>--> | ||
| <!-- </goals>--> | ||
| <!-- <configuration>--> | ||
| <!-- <inputSpec>${project.basedir}/src/main/resources/VCTemplates.yaml</inputSpec>--> | ||
| <!-- <generatorName>org.wso2.carbon.codegen.CxfWso2Generator</generatorName>--> | ||
| <!-- <configOptions>--> | ||
| <!-- <sourceFolder>src/gen/java</sourceFolder>--> | ||
| <!-- <apiPackage>org.wso2.carbon.identity.api.server.vc.template.management.v1</apiPackage>--> | ||
| <!-- <modelPackage>org.wso2.carbon.identity.api.server.vc.template.management.v1--> | ||
| <!-- </modelPackage>--> | ||
| <!-- <packageName>org.wso2.carbon.identity.api.server.vc.template.management.v1</packageName>--> | ||
| <!-- <dateLibrary>java17</dateLibrary>--> | ||
| <!-- <hideGenerationTimestamp>true</hideGenerationTimestamp>--> | ||
| <!-- <ignoreFileOverride>${project.basedir}/.openapi-generator-ignore</ignoreFileOverride>--> | ||
| <!-- </configOptions>--> | ||
| <!-- <output>.</output>--> | ||
| <!-- <skipOverwrite>false</skipOverwrite>--> | ||
| <!-- </configuration>--> | ||
| <!-- </execution>--> | ||
| <!-- </executions>--> | ||
| <!-- <dependencies>--> | ||
| <!-- <dependency>--> | ||
| <!-- <groupId>org.openapitools</groupId>--> | ||
| <!-- <artifactId>cxf-wso2-openapi-generator</artifactId>--> | ||
| <!-- <version>1.0.0</version>--> | ||
| <!-- </dependency>--> | ||
| <!-- </dependencies>--> | ||
| <!-- </plugin>--> | ||
| <plugin> | ||
| <groupId>org.codehaus.mojo</groupId> | ||
| <artifactId>build-helper-maven-plugin</artifactId> | ||
| <version>1.8</version> | ||
| <executions> | ||
| <execution> | ||
| <id>add-source</id> | ||
| <phase>generate-sources</phase> | ||
| <goals> | ||
| <goal>add-source</goal> | ||
| </goals> | ||
| <configuration> | ||
| <sources> | ||
| <source>src/gen/java</source> | ||
| <source>src/extend/java</source> | ||
| </sources> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.