Skip to content
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

fix(config-api): asset mgt save method changed and user mgt pwd validation change #8215

Merged
merged 7 commits into from
Apr 4, 2024
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