Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.server.action.management.common</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.flow.extensions</artifactId>
<version>${carbon.identity.framework.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/*
* Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update license headers

*
* 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.action.management.v1;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;
import java.util.Objects;

import javax.validation.Valid;

/**
* Access Configuration model for In-Flow Extension actions.
* Defines what context data is exposed and what operations are allowed.
*
* <p>The {@code expose} field accepts either plain strings (path prefixes) or objects with
* {@code path} and {@code encrypted} properties. When strings are provided, encryption
* defaults to {@code false}.</p>
*
* <p>Example:</p>
* <pre>{@code
* {
* "expose": [
* "/user/userId",
* { "path": "/user/claims/", "encrypted": true },
* { "path": "/user/credentials/password", "encrypted": true },
* "/properties/"
* ],
* "modify": [
* "/properties/riskScore",
* { "path": "/user/claims/email", "encrypted": true }
* ]
* }
* }</pre>
*/
public class AccessConfigModel {

private List<Object> expose;
private List<Object> modify;

public AccessConfigModel() {
// Default constructor required for Jackson
}

public AccessConfigModel expose(List<Object> expose) {

this.expose = expose;
Comment on lines +61 to +64

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 1

Suggested change
public AccessConfigModel expose(List<Object> expose) {
this.expose = expose;
public AccessConfigModel expose(List<Object> expose) {
this.expose = expose;
if (log.isDebugEnabled()) {
log.debug("Setting expose configuration with " + (expose != null ? expose.size() : 0) + " paths");
}
return this;

return this;
}

@ApiModelProperty()
@JsonProperty("expose")
@Valid
public List<Object> getExpose() {

return expose;
}

public void setExpose(List<Object> expose) {

this.expose = expose;
}

public AccessConfigModel modify(List<Object> modify) {

this.modify = modify;
Comment on lines +79 to +83

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 2

Suggested change
}
public AccessConfigModel modify(List<Object> modify) {
this.modify = modify;
public AccessConfigModel modify(List<Object> modify) {
this.modify = modify;
if (log.isDebugEnabled()) {
log.debug("Setting modify configuration with " + (modify != null ? modify.size() : 0) + " paths");
}
return this;

return this;
}

@ApiModelProperty()
@JsonProperty("modify")
@Valid
public List<Object> getModify() {

return modify;
}

public void setModify(List<Object> modify) {

this.modify = modify;
}

@Override
public boolean equals(java.lang.Object o) {

if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AccessConfigModel that = (AccessConfigModel) o;
return Objects.equals(this.expose, that.expose) &&
Objects.equals(this.modify, that.modify);
}

@Override
public int hashCode() {

return Objects.hash(expose, modify);
}

@Override
public String toString() {

StringBuilder sb = new StringBuilder();
sb.append("class AccessConfigModel {\n");
sb.append(" expose: ").append(toIndentedString(expose)).append("\n");
sb.append(" modify: ").append(toIndentedString(modify)).append("\n");
sb.append("}");
return sb.toString();
}

private String toIndentedString(java.lang.Object o) {

if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* 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.action.management.v1;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

import java.util.Objects;

import javax.validation.Valid;

/**
* Encryption configuration model for In-Flow Extension actions.
* Holds the external service's certificate used for JWE encryption of sensitive data.
*/
public class EncryptionModel {

private String certificate;

public EncryptionModel() {
// Default constructor required for Jackson
}

public EncryptionModel certificate(String certificate) {

this.certificate = certificate;
return this;
}

@ApiModelProperty()
@JsonProperty("certificate")
@Valid
public String getCertificate() {

return certificate;
}

public void setCertificate(String certificate) {

this.certificate = certificate;
}
Comment on lines +53 to +57

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 3

Suggested change
public void setCertificate(String certificate) {
this.certificate = certificate;
}
public void setCertificate(String certificate) {
if (certificate != null && !certificate.trim().isEmpty()) {
log.debug("Setting encryption certificate for external service");
}
this.certificate = certificate;
}


@Override
public boolean equals(java.lang.Object o) {

if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EncryptionModel that = (EncryptionModel) o;
return Objects.equals(this.certificate, that.certificate);
}

@Override
public int hashCode() {

return Objects.hash(certificate);
}

@Override
public String toString() {

StringBuilder sb = new StringBuilder();
sb.append("class EncryptionModel {\n");
sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n");
sb.append("}");
return sb.toString();
}

private String toIndentedString(java.lang.Object o) {

if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
Loading