Skip to content

Commit

Permalink
RC 2 Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-mcglennon-sp committed Apr 29, 2024
1 parent cc6bd96 commit 83cb3a6
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@
hs_err_pid*
replay_pid*
.DS_Store
/.idea
/.gradle
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 SailPoint
Copyright (c) 2024 SailPoint

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ ext {
junitVersion = '5.8.2'
}

sourceCompatibility = '1.17'
targetCompatibility = '1.17'
sourceCompatibility = '1.11'
targetCompatibility = '1.11'

compileJava.options.fork = true
compileJava.options.forkOptions.executable = '/opt/homebrew/Cellar/openjdk@11/11.0.23/bin/javac'

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
Expand Down
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
40 changes: 20 additions & 20 deletions src/main/java/sailpoint/utils/FileUploadUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public class FileUploadUtility implements Callable<Integer> {
/**
* Metadata about the File Upload Utility
*/
public static final String ABOUT_DATE = "2024-04-16 16:14 CST";
public static final String ABOUT_VERSION = "4.0.0";
public static final String ABOUT_DATE = "2024-04-29 11:07 CST";
public static final String ABOUT_VERSION = "4.0.0 RC 2";
public static final String ABOUT_LINK = "https://developer.sailpoint.com/discuss/t/file-upload-utility/18181";

/**
Expand All @@ -61,7 +61,7 @@ public class FileUploadUtility implements Callable<Integer> {
private boolean disableOptimization = false;

@Option( names = { "-o", "--objectType" }, description = "File Type; Account or Entitlement Schema. Default: Account" )
private String objectType = ACCOUNT_AGGREGATION;
private String objectType = DEFAULT_ACCOUNT_AGGREGATION;

@Option( names = { "-R", "--recursive" }, description = "Recursively search directories" )
private boolean recursive = false;
Expand Down Expand Up @@ -112,8 +112,7 @@ public class FileUploadUtility implements Callable<Integer> {
*/
private Map<String, String> sourceReferenceMap = null;

public static final String ACCOUNT_AGGREGATION = "Account";
public static final String ENTITLEMENT_AGGREGATION = "Entitlement";
public static final String DEFAULT_ACCOUNT_AGGREGATION = "account";

public FileUploadUtility() {
super();
Expand Down Expand Up @@ -146,12 +145,7 @@ public static void main( String[] args ) throws Exception {

} catch ( UnsupportedClassVersionError ue ) {

System.out.println("""
Unsupported version of Java:
JVM: ${java.version} (${java.vendor} ${java.vm.name} ${java.vm.version})
OS: ${os.name} ${os.version} ${os.arch}
Please upgrade to JDK 17 or higher.""");
System.out.println( "Unsupported version of Java: Please upgrade to JDK 11 or higher." );

} catch ( Exception e ) {

Expand Down Expand Up @@ -184,7 +178,7 @@ public Integer call() throws Exception {
logger.info( String.format("%1$-20s %2$-30s ", " Files:", StringUtils.join( files, ", \n" ) ) );
logger.info( String.format("%1$-20s %2$-30s ", " ObjectType:", objectType ) );

if ( ACCOUNT_AGGREGATION.equals( objectType ) )
if ( DEFAULT_ACCOUNT_AGGREGATION.equals( objectType ) )
logger.info( String.format("%1$-20s %2$-30s ", " Optimization:", !disableOptimization ) );

logger.info( String.format("%1$-20s %2$-30s ", " Recursive:", recursive ) );
Expand Down Expand Up @@ -235,12 +229,12 @@ public Integer call() throws Exception {
Iterator<File> fileIterator = FileUtils.iterateFiles( file, fileExtensions.toArray(String[]::new), recursive );

while ( fileIterator.hasNext() ) {
processFile( fileIterator.next(), objectType );
processFile( fileIterator.next() );
}

} else {
logger.info("Analyzing " + objectType + " file: " + file);
processFile( file, objectType );
processFile( file );
}
}
}
Expand Down Expand Up @@ -303,9 +297,9 @@ private void validateParameters() {
* Helper Methods
*/

private void processFile( File file, String fileType ) {
private void processFile( File file ) {

logger.info( "Analyzing " + fileType + " file: " + file.getName() );
logger.info( "Analyzing " + objectType + " file: " + file.getName() );

final String sourceId = getSourceReferenceFromFile( file );

Expand All @@ -320,15 +314,21 @@ private void processFile( File file, String fileType ) {

try {

if ( ACCOUNT_AGGREGATION.equals( fileType ) ) {
/*
* If the objectType is 'account' then we'll aggregate it as an account. This is the default behavior.
*/
if ( DEFAULT_ACCOUNT_AGGREGATION.equalsIgnoreCase( objectType ) ) {

logger.debug( "\tFile [" + file.getName() + "]: Submitting Account Aggregation: Source ID[" + sourceId + "], Disable Optimization[" + disableOptimization + "]" );
response = sailPointService.aggregateAccounts(sourceId, disableOptimization, file);

} else if ( ENTITLEMENT_AGGREGATION.equals( fileType ) ) {
/*
* If the objectType is something else then we'll aggregate it as an entitlement. Entitlement aggregations can be many different objectTypes.
*/
} else {

logger.debug( "\tFile [" + file.getName() + "]: Submitting Entitlement Aggregation: Source ID[" + sourceId + "]" );
response = sailPointService.aggregateEntitlements(sourceId, fileType, file);
logger.debug( "\tFile [" + file.getName() + "]: Submitting Entitlement Aggregation: Source ID[" + sourceId + "], Object Type[" + objectType + "]" );
response = sailPointService.aggregateEntitlements(sourceId, objectType, file);

}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
id,name,displayName,created,description,modified,entitlements,groups,permissions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
id,name,givenName,familyName,e-mail,location,manager,groups

0 comments on commit 83cb3a6

Please sign in to comment.