Skip to content

Commit

Permalink
Merge pull request #1351 from JanssenProject/jans-config-api-issue
Browse files Browse the repository at this point in the history
feat(jans-config-api): user endpoint to expose custom attributes at root level
  • Loading branch information
duttarnab committed May 18, 2022
2 parents 3fa19f4 + 3c3df7a commit 50ed982
Show file tree
Hide file tree
Showing 4 changed files with 257 additions and 35 deletions.
35 changes: 35 additions & 0 deletions agama/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Eclipse
.project
.classpath
.settings/
bin/

# IntelliJ
.idea
*.ipr
*.iml
*.iws

# NetBeans
nb-configuration.xml

# Visual Studio Code
.vscode

# OSX
.DS_Store

# Vim
*.swp
*.swo

# patch
*.orig
*.rej

# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties
34 changes: 26 additions & 8 deletions jans-config-api/docs/jans-config-api-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,7 @@ paths:
title: Users.
description: List of users.
items:
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/CustomUser'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
Expand Down Expand Up @@ -2500,15 +2500,15 @@ paths:
schema:
title: User Details.
description: User Details.
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/CustomUser'
responses:
'201':
description: Created
content:
application/json:
schema:
title: User Details.
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/CustomUser'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
Expand All @@ -2526,15 +2526,15 @@ paths:
application/json:
schema:
title: User Details.
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/CustomUser'
responses:
'200':
description: OK
content:
application/json:
schema:
title: User Details.
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/CustomUser'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
Expand Down Expand Up @@ -2563,7 +2563,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/CustomUser'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
Expand Down Expand Up @@ -2608,7 +2608,7 @@ paths:
application/json:
schema:
title: User Details.
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/CustomUser'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
Expand Down Expand Up @@ -6687,7 +6687,7 @@ components:
$ref: '#/components/schemas/FacterData'
description: Underlying Server stats

User:
CustomUser:
title: User object
description: User.
type: object
Expand All @@ -6697,6 +6697,12 @@ components:
dn:
type: string
description: Domain name.
baseDN:
type: string
description: Base DN for the User entity
status:
type: string
description: User status
userId:
description: A domain issued and managed identifier for the user.
type: string
Expand All @@ -6718,6 +6724,18 @@ components:
type: array
items:
$ref: '#/components/schemas/CustomAttribute'
mail:
type: string
description: User mail
displayName:
type: string
description: Name of the user suitable for display to end-users
givenName:
type: string
description: User given Name
userPassword:
type: string
description: User password

UserPatchRequest:
title: User Patch Request object
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package io.jans.configapi.plugin.mgt.model.user;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import io.jans.as.common.model.common.User;

@JsonIgnoreProperties(ignoreUnknown = true)
public class CustomUser extends User {

private static final long serialVersionUID = 1L;

private String mail;
private String displayName;
private String jansStatus;
private String givenName;
private String userPassword;

public String getMail() {
return mail;
}
public void setMail(String mail) {
this.mail = mail;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getJansStatus() {
return jansStatus;
}
public void setJansStatus(String jansStatus) {
this.jansStatus = jansStatus;
}
public String getGivenName() {
return givenName;
}
public void setGivenName(String givenName) {
this.givenName = givenName;
}
public String getUserPassword() {
return userPassword;
}
public void setUserPassword(String userPassword) {
this.userPassword = userPassword;
}
@Override
public String toString() {
return "CustomUser [mail=" + mail + ", displayName=" + displayName + ", jansStatus=" + jansStatus + ", givenName="
+ givenName + ", userPassword= XXXXX ]";
}

}
Loading

0 comments on commit 50ed982

Please sign in to comment.