Skip to content

Commit

Permalink
fix(config-api): asset mgt save method changed and user mgt pwd valid…
Browse files Browse the repository at this point in the history
…ation change (#8215)

* fix(config-api): asset scope rename and get endpoint modification

Signed-off-by: pujavs <pujas.works@gmail.com>

* fix(config-api): asset scope rename and get endpoint modification

Signed-off-by: pujavs <pujas.works@gmail.com>

* fix(config-api): changes to call save binary method to save document

Signed-off-by: pujavs <pujas.works@gmail.com>

* fix(config-api): check for user pwd in case of update

Signed-off-by: pujavs <pujas.works@gmail.com>

---------

Signed-off-by: pujavs <pujas.works@gmail.com>
  • Loading branch information
pujavs committed Apr 4, 2024
1 parent 88f84a8 commit c551e63
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
12 changes: 6 additions & 6 deletions jans-config-api/docs/jans-config-api-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8219,19 +8219,19 @@ components:
type: string
selected:
type: boolean
adminCanEdit:
whitePagesCanView:
type: boolean
adminCanView:
type: boolean
adminCanEdit:
type: boolean
userCanEdit:
type: boolean
userCanView:
type: boolean
userCanAccess:
type: boolean
adminCanAccess:
type: boolean
whitePagesCanView:
userCanAccess:
type: boolean
baseDn:
type: string
Expand Down Expand Up @@ -9053,8 +9053,6 @@ components:
type: boolean
lockMessageConfig:
$ref: '#/components/schemas/LockMessageConfig'
fapi:
type: boolean
allResponseTypesSupported:
uniqueItems: true
type: array
Expand All @@ -9064,6 +9062,8 @@ components:
- code
- token
- id_token
fapi:
type: boolean
AuthenticationFilter:
required:
- baseDn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

import static io.jans.as.model.util.Util.escapeLog;

import org.apache.commons.lang.StringUtils;

@Path(Constants.CONFIG_USER)
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
Expand Down Expand Up @@ -435,11 +437,17 @@ private User setUserAttributes(CustomUser customUser) {
}

private User setUserCustomAttributes(CustomUser customUser, User user) {
user.setAttribute(MAIL, customUser.getMail(), false);
if(StringUtils.isNotBlank(customUser.getMail())) {
user.setAttribute(MAIL, customUser.getMail(), false);
}

user.setAttribute(DISPLAY_NAME, customUser.getDisplayName(), false);
user.setAttribute(JANS_STATUS, customUser.getJansStatus(), false);
user.setAttribute(GIVEN_NAME, customUser.getGivenName(), false);
user.setAttribute(USER_PWD, customUser.getUserPassword(), false);

if(StringUtils.isNotBlank(customUser.getUserPassword())) {
user.setAttribute(USER_PWD, customUser.getUserPassword(), false);
}
user.setAttribute(INUM, customUser.getInum(), false);

logger.debug("Custom User - user:{}", user);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private Document updateRevision(Document asset) {

private Document saveNewAsset(Document asset, InputStream stream) {
log.info("Saving new asset in DB DocumentStore - asset:{}, stream:{}", asset, stream);
String path = dBDocumentStoreProvider.saveDocumentStream(asset.getDisplayName(), asset.getDescription(), stream,
String path = dBDocumentStoreProvider.saveBinaryDocumentStream(asset.getDisplayName(), asset.getDescription(), stream,
asset.getJansModuleProperty());
log.info("Successfully stored asset - Path of saved new asset is :{}", path);
return asset;
Expand Down

0 comments on commit c551e63

Please sign in to comment.