Skip to content

Commit

Permalink
Merge pull request #235 from AfraHussaindeen/master_idvp-remove-unuse…
Browse files Browse the repository at this point in the history
…d-api

Remove the API's that should restrict the user's access.
  • Loading branch information
AfraHussaindeen authored Dec 20, 2024
2 parents b85465b + 6d18be1 commit 88ca86e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 279 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
import java.util.List;

import org.wso2.carbon.identity.rest.api.user.idv.v1.model.Error;
import java.util.List;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationClaimRequest;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationClaimResponse;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationClaimUpdateRequest;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationPostResponse;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerifyRequest;
import org.wso2.carbon.identity.rest.api.user.idv.v1.MeApiService;
Expand All @@ -48,30 +45,6 @@ public class MeApi {
@Autowired
private MeApiService delegate;

@Valid
@POST
@Path("/idv/claims")
@Consumes({ "application/json" })
@Produces({ "application/json", "application/xml", })
@ApiOperation(value = "Add identity verification claim.", notes = "This API provides the capability to add verification claim data", response = List.class, responseContainer = "List", authorizations = {
@Authorization(value = "BasicAuth"),
@Authorization(value = "OAuth2", scopes = {

})
}, tags={ "Me - Identity Verification", })
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Successful response", response = VerificationClaimResponse.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Bad Request", response = Error.class),
@ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@ApiResponse(code = 403, message = "Forbidden", response = Void.class),
@ApiResponse(code = 409, message = "Conflict", response = Error.class),
@ApiResponse(code = 500, message = "Server Error", response = Error.class)
})
public Response meAddIdVClaim(@ApiParam(value = "This represents the identity provider to be created." ,required=true) @Valid List<VerificationClaimRequest> verificationClaimRequest) {

return delegate.meAddIdVClaim(verificationClaimRequest );
}

@Valid
@GET
@Path("/idv/claims/{claim-id}")
Expand Down Expand Up @@ -120,54 +93,6 @@ public Response meGetIdVClaims( @Valid@ApiParam(value = "Id of the identity v
return delegate.meGetIdVClaims(idVProviderId );
}

@Valid
@PUT
@Path("/idv/claims/{claim-id}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
@ApiOperation(value = "Update identity verification claim", notes = "This API provides the capability to update a identity verification claim of a user.", response = VerificationClaimResponse.class, authorizations = {
@Authorization(value = "BasicAuth"),
@Authorization(value = "OAuth2", scopes = {

})
}, tags={ "Me - Identity Verification", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful response", response = VerificationClaimResponse.class),
@ApiResponse(code = 400, message = "Bad Request", response = Error.class),
@ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@ApiResponse(code = 403, message = "Forbidden", response = Void.class),
@ApiResponse(code = 404, message = "Not Found", response = Error.class),
@ApiResponse(code = 500, message = "Server Error", response = Error.class)
})
public Response meUpdateIdVClaim(@ApiParam(value = "Claim that needs to retrieve verification metadata",required=true) @PathParam("claim-id") String claimId, @ApiParam(value = "" ,required=true) @Valid VerificationClaimUpdateRequest verificationClaimUpdateRequest) {

return delegate.meUpdateIdVClaim(claimId, verificationClaimUpdateRequest );
}

@Valid
@PUT
@Path("/idv/claims")
@Consumes({ "application/json" })
@Produces({ "application/json", "application/xml", })
@ApiOperation(value = "Update identity verification claims.", notes = "This API provides the capability to update verification claims of a user", response = List.class, responseContainer = "List", authorizations = {
@Authorization(value = "BasicAuth"),
@Authorization(value = "OAuth2", scopes = {

})
}, tags={ "Me - Identity Verification", })
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Successful response", response = VerificationClaimResponse.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Bad Request", response = Error.class),
@ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@ApiResponse(code = 403, message = "Forbidden", response = Void.class),
@ApiResponse(code = 409, message = "Conflict", response = Error.class),
@ApiResponse(code = 500, message = "Server Error", response = Error.class)
})
public Response meUpdateIdVClaims(@ApiParam(value = "This represents the identity provider to be created." ,required=true) @Valid List<VerificationClaimRequest> verificationClaimRequest) {

return delegate.meUpdateIdVClaims(verificationClaimRequest );
}

@Valid
@POST
@Path("/idv/verify")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,17 @@
import java.io.InputStream;
import java.util.List;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.Error;
import java.util.List;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationClaimRequest;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationClaimResponse;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationClaimUpdateRequest;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationPostResponse;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerifyRequest;
import javax.ws.rs.core.Response;


public interface MeApiService {

public Response meAddIdVClaim(List<VerificationClaimRequest> verificationClaimRequest);

public Response meGetIdVClaim(String claimId);

public Response meGetIdVClaims(String idVProviderId);

public Response meUpdateIdVClaim(String claimId, VerificationClaimUpdateRequest verificationClaimUpdateRequest);

public Response meUpdateIdVClaims(List<VerificationClaimRequest> verificationClaimRequest);

public Response meVerifyIdentity(VerifyRequest verifyRequest);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.wso2.carbon.identity.rest.api.user.idv.v1.MeApiService;
import org.wso2.carbon.identity.rest.api.user.idv.v1.core.IdentityVerificationService;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationClaimRequest;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationClaimResponse;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationClaimUpdateRequest;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerificationPostResponse;
import org.wso2.carbon.identity.rest.api.user.idv.v1.model.VerifyRequest;

Expand All @@ -41,14 +39,6 @@ public class MeApiServiceImpl implements MeApiService {
@Autowired
IdentityVerificationService identityVerificationService;

@Override
public Response meAddIdVClaim(List<VerificationClaimRequest> verificationClaimRequest) {

List<VerificationClaimResponse> idvAddClaimResponse =
identityVerificationService.addIdVClaims(getUserIdFromContext(), verificationClaimRequest);
return Response.ok().entity(idvAddClaimResponse).build();
}

@Override
public Response meGetIdVClaim(String claimId) {

Expand All @@ -65,22 +55,6 @@ public Response meGetIdVClaims(String idvProviderid) {
return Response.ok().entity(verificationGetResponse).build();
}

@Override
public Response meUpdateIdVClaim(String claimId, VerificationClaimUpdateRequest verificationClaimUpdateRequest) {

VerificationClaimResponse verificationClaimResponse = identityVerificationService.
updateIdVClaim(getUserIdFromContext(), claimId, verificationClaimUpdateRequest);
return Response.ok().entity(verificationClaimResponse).build();
}

@Override
public Response meUpdateIdVClaims(List<VerificationClaimRequest> verificationClaimRequest) {

List<VerificationClaimResponse> idvClaimUpdateResponse = identityVerificationService.
updateIdVClaims(getUserIdFromContext(), verificationClaimRequest);
return Response.ok().entity(idvClaimUpdateResponse).build();
}

@Override
public Response meVerifyIdentity(VerifyRequest verifyRequest) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,122 +125,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
post:
tags:
- Me - Identity Verification
summary: Add identity verification claim.
description: >
This API provides the capability to add verification claim data.
<br><b>Permission required:</b> <br>
* None <br>
<b>Scope required:</b> <br>
* internal_login
operationId: meAddIdVClaim
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/verificationClaimPostRequest'
description: This represents the identity provider to be created.
required: true
responses:
'201':
description: Successful response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/verificationClaimPostResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
'403':
description: Forbidden
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/Error'
put:
tags:
- Me - Identity Verification
summary: Update identity verification claims.
description: >
This API provides the capability to update verification claims of a user.
<br><b>Permission required:</b> <br>
* None <br>
<b>Scope required:</b> <br>
* internal_login
operationId: meUpdateIdVClaims
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/verificationClaimPostRequest'
description: This represents the identity provider to be created.
required: true
responses:
'201':
description: Successful response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/verificationClaimPostResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
'403':
description: Forbidden
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/Error'
/me/idv/claims/{claim-id}:
get:
tags:
Expand Down Expand Up @@ -291,59 +175,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
tags:
- Me - Identity Verification
summary: Update identity verification claim
description: >
This API provides the capability to update a identity verification claim of a user.
<br><b>Permission required:</b> <br>
* None
<br><b>Scope required:</b> <br>
* internal_login
operationId: meUpdateIdVClaim
parameters:
- name: claim-id
in: path
description: Claim that needs to retrieve verification metadata
required: true
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/verificationClaimResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/verificationClaimUpdateRequest'
required: true
/{user-id}/idv/verify:
post:
tags:
Expand Down

0 comments on commit 88ca86e

Please sign in to comment.