Skip to content

Commit

Permalink
36: Initial controllers and their interfaces for VRPs
Browse files Browse the repository at this point in the history
- There are no request parameters in v3.1.8 of the VRP swagger spec, meaning the generated code did not have any request body objects or headers. I have added the request body objects manually, but they may not e correct.
- I assume this is a mistake in the swagger spec and have created this issue: OpenBankingUK/read-write-api-specs#51
- As per other controllers in the Read/Write API, a number of annotations (e.g. @PreAuthorize and @OpenBankingAPI) need adding. I have inserted them in commented out sections, but certain things (e.g.  the scopes) may not be correct.

Issue: OpenBankingToolkit/openbanking-toolkit#36
  • Loading branch information
matt-wills authored and BohoCode committed Nov 26, 2021
1 parent 3d7bd17 commit 38b14cb
Show file tree
Hide file tree
Showing 5 changed files with 459 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
# Git Changelog Maven plugin changelog
Changelog of Git Changelog Maven plugin.
## Unreleased
<<<<<<< HEAD
[4833a4411f2b7f9](https://github.com/OpenBankingToolkit/openbanking-aspsp/commit/4833a4411f2b7f9) JamieB *2021-11-26 09:45:58*
Release candidate: prepare for next development iteration
## 1.5.6
=======
[b0704b02d1c8154](https://github.com/OpenBankingToolkit/openbanking-aspsp/commit/b0704b02d1c8154) JamieB *2021-06-02 13:53:21*
Release candidate: prepare for next development iteration
## 1.4.4
[41f8db04407bd5d](https://github.com/OpenBankingToolkit/openbanking-aspsp/commit/41f8db04407bd5d) JamieB *2021-06-02 13:53:15*
Release candidate: prepare release 1.4.4
[431a39cb7f64e75](https://github.com/OpenBankingToolkit/openbanking-aspsp/commit/431a39cb7f64e75) JamieB *2021-06-02 13:48:15*
749: set dev version to 1.4.4-SNAPSHOT before creating release

Something odd has happened with the aspsp versions. We're using 1.4.3
currently in openbanking-reference-implementation, but master has
1.4.3-SNAPSHOT in the poms!!!

Issue: https://github.com/ForgeCloud/ob-deploy/issues/749
>>>>>>> cc8df318 (36: Initial controllers and their interfaces for VRPs)
### GitHub [#456](https://github.com/OpenBankingToolkit/openbanking-aspsp/pull/456) 794: UI redirection customer experience
[eb58e6dccb7cb99](https://github.com/OpenBankingToolkit/openbanking-aspsp/commit/eb58e6dccb7cb99) Jorge Sanchez Perez *2021-11-16 16:04:23*
794: UI redirection customer experience (#456)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/**
* Copyright 2019 ForgeRock AS.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.3.1).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.forgerock.openbanking.aspsp.rs.api.vrp.v3_1_8;

import com.forgerock.openbanking.exceptions.OBErrorResponseException;
import io.swagger.annotations.*;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import uk.org.openbanking.datamodel.vrp.OBDomesticVRPConsentRequest;
import uk.org.openbanking.datamodel.vrp.OBDomesticVRPConsentResponse;
import uk.org.openbanking.datamodel.vrp.OBVRPFundsConfirmationRequest;

import javax.validation.Valid;

import static org.springframework.web.bind.annotation.RequestMethod.DELETE;
import static org.springframework.web.bind.annotation.RequestMethod.POST;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-05-27T13:44:23.551801+01:00[Europe/London]")

//@OpenBankingAPI(
// obVersion = "3.1.8",
// obGroupName = OBGroupName.VRP,
// obReference = OBReference.VARIABLE_RECURRING_PAYMENTS
//)
@Validated
@Api(value = "domestic-vrp-consents", description = "the domestic-vrp-consents API")
public interface DomesticVrpConsentsApi {

static String DOMESTIC_VRP_CONSENTS = "/domestic-vrp-consents";

/**
* POST /domestic-vrp-consents : create a domestic vrp
* create a domestic vrp
*
* @return (status code 201)
*/
@ApiOperation(
value = "create a domestic vrp",
nickname = "domesticVrpConsentsPost",
notes = "create a domestic vrp",
response = OBDomesticVRPConsentResponse.class,
// authorizations = {
// @Authorization(value = "TPPOAuth2Security", scopes = {
// @AuthorizationScope(scope = "vrps", description = "Generic VRPs scope")
// })
// },
tags = {"variable-recurring-payments",})
@ApiResponses(value = {@ApiResponse(code = 201, message = "", response = OBDomesticVRPConsentResponse.class)})
//@PreAuthorize("hasAuthority('ROLE_VRP')")
//@OpenBankingAPI(
// obReference = OBReference.CREATE_DOMESTIC_VRP_CONSENT
//)
@RequestMapping(
value = DOMESTIC_VRP_CONSENTS,
produces = {"application/json"},
method = POST)
ResponseEntity<OBDomesticVRPConsentResponse> createDomesticVrpConsent(
@ApiParam(value = "Default", required = true)
@Valid
@RequestBody OBDomesticVRPConsentRequest domesticVRPConsentRequest // added manually
// none of the headers have been generated from the open-api spec
) throws OBErrorResponseException;

/**
* GET /domestic-vrp-consents/:consentId : create a domestic vrp
* create a domestic vrp
*
* @return (status code 200)
*/
@ApiOperation(
value = "create a domestic vrp",
nickname = "domesticVrpConsentsConsentIdGet",
notes = "create a domestic vrp",
response = OBDomesticVRPConsentResponse.class,
// authorizations = {
// @Authorization(value = "TPPOAuth2Security", scopes = {
// @AuthorizationScope(scope = "vrps", description = "Generic VRPs scope")
// })
// },
tags = {"variable-recurring-payments",})
@ApiResponses(value = {@ApiResponse(code = 200, message = "", response = OBDomesticVRPConsentResponse.class)})
//@PreAuthorize("hasAuthority('ROLE_VRP')")
//@OpenBankingAPI(
// obReference = OBReference.GET_DOMESTIC_VRP_CONSENT
//)
@RequestMapping(
value = DOMESTIC_VRP_CONSENTS + "/:consentId",
produces = {"application/json"},
method = RequestMethod.GET)
ResponseEntity<OBDomesticVRPConsentResponse> getDomesticVrpConsent() throws OBErrorResponseException;

/**
* DELETE /domestic-vrp-consents/:consentId : create a domestic vrp
* create a domestic vrp
*
* @return all good (status code 204)
*/
@ApiOperation(
value = "create a domestic vrp",
nickname = "domesticVrpConsentsConsentIdDelete",
notes = "create a domestic vrp",
// authorizations = {
// @Authorization(value = "TPPOAuth2Security", scopes = {
// @AuthorizationScope(scope = "vrps", description = "Generic VRPs scope")
// })
// },
tags = {"variable-recurring-payments",})
@ApiResponses(value = {@ApiResponse(code = 204, message = "all good")})
//@PreAuthorize("hasAuthority('ROLE_VRP')")
//@OpenBankingAPI(
// obReference = OBReference.DELETE_DOMESTIC_VRP_CONSENT
//)
@RequestMapping(value = DOMESTIC_VRP_CONSENTS + "/:consentId", method = DELETE)
ResponseEntity<Void> deleteDomesticVrpConsent() throws OBErrorResponseException;

/**
* POST /domestic-vrp-consents/:consentId/funds-confirmation : create a domestic vrp
* create a domestic vrp
*
* @return (status code 200)
*/
@ApiOperation(
value = "create a domestic vrp",
nickname = "domesticVrpConsentsConsentIdFundsConfirmationPost",
notes = "create a domestic vrp",
response = Object.class,
// authorizations = {
// @Authorization(value = "TPPOAuth2Security", scopes = {
// @AuthorizationScope(scope = "vrps", description = "Generic VRPs scope")
// })
// },
tags = {"variable-recurring-payments",})
@ApiResponses(value = {@ApiResponse(code = 200, message = "", response = Object.class)})
//@PreAuthorize("hasAuthority('ROLE_VRP')")
//@OpenBankingAPI(
// obReference = OBReference.CREATE_DOMESTIC_VRP_CONSENT_FUNDS_CONFIRMATION
//)
@RequestMapping(
value = DOMESTIC_VRP_CONSENTS + "/:consentId/funds-confirmation",
produces = {"application/json"},
method = POST)
ResponseEntity<Object> createDomesticVrpConsentsConsentFundsConfirmation(
@ApiParam(value = "Default", required = true)
@Valid
@RequestBody OBVRPFundsConfirmationRequest vrpFundsConfirmationRequest) throws OBErrorResponseException;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* Copyright 2019 ForgeRock AS.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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 com.forgerock.openbanking.aspsp.rs.api.vrp.v3_1_8;

import com.forgerock.openbanking.exceptions.OBErrorResponseException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import uk.org.openbanking.datamodel.vrp.OBDomesticVRPConsentRequest;
import uk.org.openbanking.datamodel.vrp.OBDomesticVRPConsentResponse;
import uk.org.openbanking.datamodel.vrp.OBVRPFundsConfirmationRequest;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-05-27T13:44:23.551801+01:00[Europe/London]")

@Controller("DomesticVrpConsentsApiControllerV3.1.8")
public class DomesticVrpConsentsApiController implements DomesticVrpConsentsApi {

@Override
public ResponseEntity<OBDomesticVRPConsentResponse> createDomesticVrpConsent(
OBDomesticVRPConsentRequest domesticVRPConsentRequest
) throws OBErrorResponseException {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}

@Override
public ResponseEntity<OBDomesticVRPConsentResponse> getDomesticVrpConsent() {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}

@Override
public ResponseEntity<Void> deleteDomesticVrpConsent() {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}


@Override
public ResponseEntity<Object> createDomesticVrpConsentsConsentFundsConfirmation(
OBVRPFundsConfirmationRequest vrpFundsConfirmationRequest
) throws OBErrorResponseException {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
}
Loading

0 comments on commit 38b14cb

Please sign in to comment.