-
Notifications
You must be signed in to change notification settings - Fork 43
Adding consent manage PUT to update basic consent and authorisation resource with ID #911
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
Closed
Closed
Changes from all commits
Commits
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
2,703 changes: 2,703 additions & 0 deletions
2,703
...celerator/accelerators/fs-is/repository/resources/apis/accelerator-extensions-v1.0.4.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
151 changes: 151 additions & 0 deletions
151
...erator/consent/mgt/extensions/common/model/ExternalAPIBasicConsentResourceRequestDTO.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,151 @@ | ||
| /** | ||
| * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). | ||
| * <p> | ||
| * 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 | ||
| * <p> | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * <p> | ||
| * 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.financial.services.accelerator.consent.mgt.extensions.common.model; | ||
|
|
||
| import org.json.JSONObject; | ||
| import org.wso2.financial.services.accelerator.consent.mgt.dao.models.ConsentResource; | ||
|
|
||
| import java.util.Collections; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Basic Consent resource model for the API extension consent management. | ||
| */ | ||
Ashi1993 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public class ExternalAPIBasicConsentResourceRequestDTO { | ||
|
|
||
| private String id; | ||
| private String clientId; | ||
| private String type; | ||
| private String status; | ||
| private int frequency; | ||
| private long validityTime; | ||
| private long createdTime; | ||
| private long updatedTime; | ||
| private boolean recurringIndicator; | ||
| private Map<String, Object> receipt; | ||
| private Map<String, String> attributes; | ||
|
|
||
| public ExternalAPIBasicConsentResourceRequestDTO(ConsentResource consentResource) { | ||
Ashi1993 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| this.id = consentResource.getConsentID(); | ||
| this.clientId = consentResource.getClientID(); | ||
| this.type = consentResource.getConsentType(); | ||
| this.status = consentResource.getCurrentStatus(); | ||
| this.frequency = consentResource.getConsentFrequency(); | ||
| this.validityTime = consentResource.getValidityPeriod(); | ||
| this.createdTime = consentResource.getCreatedTime(); | ||
| this.updatedTime = consentResource.getUpdatedTime(); | ||
| this.recurringIndicator = consentResource.isRecurringIndicator(); | ||
|
|
||
| if (consentResource.getReceipt() != null && !consentResource.getReceipt().isEmpty()) { | ||
| JSONObject receiptJson = new JSONObject(consentResource.getReceipt()); | ||
| this.receipt = receiptJson.toMap(); | ||
Ashi1993 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } else { | ||
| this.receipt = Collections.emptyMap(); | ||
| } | ||
| this.attributes = consentResource.getConsentAttributes(); | ||
| } | ||
|
|
||
| public String getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public void setId(String id) { | ||
| this.id = id; | ||
| } | ||
|
|
||
| public String getClientId() { | ||
| return clientId; | ||
| } | ||
|
|
||
| public void setClientId(String clientId) { | ||
| this.clientId = clientId; | ||
| } | ||
|
|
||
| public String getType() { | ||
| return type; | ||
| } | ||
|
|
||
| public void setType(String type) { | ||
| this.type = type; | ||
| } | ||
|
|
||
| public String getStatus() { | ||
| return status; | ||
| } | ||
|
|
||
| public void setStatus(String status) { | ||
| this.status = status; | ||
| } | ||
|
|
||
| public int getFrequency() { | ||
| return frequency; | ||
| } | ||
|
|
||
| public void setFrequency(int frequency) { | ||
| this.frequency = frequency; | ||
| } | ||
|
|
||
| public long getValidityTime() { | ||
| return validityTime; | ||
| } | ||
|
|
||
| public void setValidityTime(long validityTime) { | ||
| this.validityTime = validityTime; | ||
| } | ||
|
|
||
| public long getCreatedTime() { | ||
| return createdTime; | ||
| } | ||
|
|
||
| public void setCreatedTime(long createdTime) { | ||
| this.createdTime = createdTime; | ||
| } | ||
|
|
||
| public long getUpdatedTime() { | ||
| return updatedTime; | ||
| } | ||
|
|
||
| public void setUpdatedTime(long updatedTime) { | ||
| this.updatedTime = updatedTime; | ||
| } | ||
|
|
||
| public boolean getRecurringIndicator() { | ||
| return recurringIndicator; | ||
| } | ||
|
|
||
| public void setRecurringIndicator(boolean recurringIndicator) { | ||
| this.recurringIndicator = recurringIndicator; | ||
| } | ||
|
|
||
| public Map<String, Object> getReceipt() { | ||
| return receipt; | ||
| } | ||
|
|
||
| public void setReceipt(Map<String, Object> receipt) { | ||
| this.receipt = receipt; | ||
| } | ||
|
|
||
| public Map<String, String> getAttributes() { | ||
| return attributes; | ||
| } | ||
|
|
||
| public void setAttributes(Map<String, String> attributes) { | ||
| this.attributes = attributes; | ||
| } | ||
| } | ||
91 changes: 91 additions & 0 deletions
91
...rator/consent/mgt/extensions/common/model/ExternalAPIBasicConsentResourceResponseDTO.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,91 @@ | ||
| /** | ||
| * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). | ||
| * <p> | ||
| * 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 | ||
| * <p> | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * <p> | ||
| * 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.financial.services.accelerator.consent.mgt.extensions.common.model; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Basic Consent resource response model for the API extension consent management. | ||
| */ | ||
| public class ExternalAPIBasicConsentResourceResponseDTO { | ||
|
|
||
| private String type; | ||
| private String status; | ||
| private Integer frequency; | ||
| private Long validityTime; | ||
| private Boolean recurringIndicator; | ||
| private Map<String, Object> receipt; | ||
| private Map<String, String> attributes; | ||
|
|
||
| public String getType() { | ||
| return type; | ||
| } | ||
|
|
||
| public void setType(String type) { | ||
| this.type = type; | ||
| } | ||
|
|
||
| public String getStatus() { | ||
| return status; | ||
| } | ||
|
|
||
| public void setStatus(String status) { | ||
| this.status = status; | ||
| } | ||
|
|
||
| public Integer getFrequency() { | ||
| return frequency; | ||
| } | ||
|
|
||
| public void setFrequency(Integer frequency) { | ||
| this.frequency = frequency; | ||
| } | ||
|
|
||
| public Long getValidityTime() { | ||
| return validityTime; | ||
| } | ||
|
|
||
| public void setValidityTime(Long validityTime) { | ||
| this.validityTime = validityTime; | ||
| } | ||
|
|
||
| public Boolean getRecurringIndicator() { | ||
| return recurringIndicator; | ||
| } | ||
|
|
||
| public void setRecurringIndicator(Boolean recurringIndicator) { | ||
| this.recurringIndicator = recurringIndicator; | ||
| } | ||
|
|
||
| public Map<String, Object> getReceipt() { | ||
| return receipt; | ||
| } | ||
|
|
||
| public void setReceipt(Map<String, Object> receipt) { | ||
| this.receipt = receipt; | ||
| } | ||
|
|
||
| public Map<String, String> getAttributes() { | ||
| return attributes; | ||
| } | ||
|
|
||
| public void setAttributes(Map<String, String> attributes) { | ||
| this.attributes = attributes; | ||
| } | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle null attribute rows before switching this query to
LEFT JOIN.With this join, a consent that has no rows in
FS_CONSENT_ATTRIBUTEnow comes back as a single row withATT_KEY/ATT_VALUE = NULL.ConsentCoreDAOImpl.getConsentResourceWithAttributes(...)passes thatResultSetstraight intoConsentManagementDAOUtil.setDataToConsentResourceWithAttributes(...), and that mapper currently does an unconditionalput(getString(ATT_KEY), getString(ATT_VALUE)). The result is a malformed attributes map ({null=null}) instead of an empty one for attribute-less consents. Please either guard null/blank keys in the mapper or keep the old join semantics until that mapper is fixed.🤖 Prompt for AI Agents