Skip to content
Closed
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 @@ -1032,7 +1032,7 @@ private void waitForShutdown(final String pid, final Logger logger, final File s
final long waitSeconds = TimeUnit.NANOSECONDS.toSeconds(waitNanos);
if (waitSeconds >= gracefulShutdownSeconds && gracefulShutdownSeconds > 0) {
if (isProcessRunning(pid, logger)) {
logger.warn("NiFi PID [{}] shutdown not completed after {} seconds: Killing process", gracefulShutdownSeconds);
logger.warn("NiFi PID [{}] shutdown not completed after {} seconds: Killing process", pid, gracefulShutdownSeconds);
try {
killProcessTree(pid, logger);
} catch (final IOException ioe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public UserAndGroups getUserAndGroups(String identity) throws AuthorizationAcces
compositeUserAndGroups.setUser(userAndGroups.getUser());
providerClassForUser = userGroupProvider.getClass().getName();
} else {
logger.warn("Multiple UserGroupProviders are claiming to provide user '{}': [{} and {}] ",
logger.warn("Multiple UserGroupProviders are claiming to provide identity [{}] user '{}': [{} and {}] ",
identity,
userAndGroups.getUser(),
providerClassForUser, userGroupProvider.getClass().getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Collection<String> listNars() throws IOException {
final Set<NiFiRegistryExtensionBundleMetadata> bundleMetadata = extensionRegistry.getExtensionBundleMetadata(null);
return bundleMetadata.stream().map(bm -> bm.toLocationString()).collect(Collectors.toSet());
} catch (final ExtensionRegistryException ere) {
LOGGER.error("Unable to retrieve listing of NARs from NiFi Registry at []", extensionRegistry.getURL(), ere);
LOGGER.error("Unable to retrieve listing of NARs from NiFi Registry at [{}]", extensionRegistry.getURL(), ere);
return Collections.emptySet();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void run() {
}
} catch (final Exception e) {
// TODO: Add SocketProtocolListener#handleTlsError logic here
String msg = String.format("RemoteSiteListener Unable to accept connection from {} due to {}", socket, e.getLocalizedMessage());
String msg = String.format("RemoteSiteListener Unable to accept connection from %s due to %s", socket, e.getLocalizedMessage());
// Suppress repeated TLS errors
if (CertificateUtils.isTlsError(e)) {
boolean printedAsWarning = handleTlsError(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected void checkPortStatus(final Peer peer, String portId) throws HandshakeE
this.port = (PublicPort) receivedPort;
final PortAuthorizationResult portAuthResult = this.port.checkUserAuthorization(peer.getCommunicationsSession().getUserDn());
if (!portAuthResult.isAuthorized()) {
logger.debug("Responding with ResponseCode UNAUTHORIZED: ", portAuthResult.getExplanation());
logger.debug("Responding with ResponseCode UNAUTHORIZED: {}", portAuthResult.getExplanation());
throw new HandshakeException(ResponseCode.UNAUTHORIZED, portAuthResult.getExplanation());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ public Response createPortTransaction(
return validationResult.errResponse;
}

logger.debug("createPortTransaction request: clientId={}, portType={}, portId={}", portType, portId);

final ByteArrayOutputStream out = new ByteArrayOutputStream();
final String transactionId = transactionManager.createTransaction();
final Peer peer = constructPeer(req, inputStream, out, portId, transactionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@
public class OIDCAccessResource extends ApplicationResource {

private static final Logger logger = LoggerFactory.getLogger(OIDCAccessResource.class);
private static final String OIDC_AUTHENTICATION_FAILED = "OIDC authentication attempt failed: ";
private static final String OIDC_AUTHENTICATION_NOT_CONFIGURED = "OIDC authentication not configured";
private static final String OIDC_ID_TOKEN_AUTHN_ERROR = "Unable to exchange authorization for ID token: ";
private static final String OIDC_IS_NOT_CONFIGURED_MESSAGE = "OIDC is not configured.";
private static final String OIDC_REQUEST_IDENTIFIER_NOT_FOUND = "The request identifier was not found in the request.";
private static final String OIDC_FAILED_TO_PARSE_REDIRECT_URI = "Unable to parse the redirect URI from the OpenId Connect Provider. Unable to continue login/logout process.";
private static final String REVOKE_ACCESS_TOKEN_LOGOUT = "oidc_access_token_logout";
Expand Down Expand Up @@ -193,7 +192,7 @@ public Response oidcExchange(@Context HttpServletRequest httpServletRequest, @Co
try {
validateOidcConfiguration();
} catch (final AuthenticationNotSupportedException e) {
logger.debug(OIDC_AUTHENTICATION_FAILED, e.getMessage());
logger.debug("OIDC authentication not supported", e);
return Response.status(Response.Status.CONFLICT).entity(e.getMessage()).build();
}

Expand Down Expand Up @@ -230,7 +229,6 @@ public void oidcLogout(@Context HttpServletRequest httpServletRequest, @Context
try {
validateOidcConfiguration();
} catch (final AuthenticationNotSupportedException e) {
logger.debug(OIDC_AUTHENTICATION_FAILED, e.getMessage());
throw e;
}

Expand Down Expand Up @@ -471,7 +469,6 @@ protected AuthenticationResponse parseOidcResponse(HttpServletRequest httpServle
try {
validateOidcConfiguration();
} catch (final AuthenticationNotSupportedException e) {
logger.debug(OIDC_AUTHENTICATION_FAILED, e.getMessage());
forwardToMessagePage(httpServletRequest, httpServletResponse, pageTitle, e.getMessage());
throw e;
}
Expand Down Expand Up @@ -529,7 +526,7 @@ private void validateOidcConfiguration() throws AuthenticationNotSupportedExcept

// ensure OIDC is actually configured/enabled
if (!oidcService.isOidcEnabled()) {
throw new AuthenticationNotSupportedException(OIDC_IS_NOT_CONFIGURED_MESSAGE);
throw new AuthenticationNotSupportedException(OIDC_AUTHENTICATION_NOT_CONFIGURED);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ public int compare(final File o1, final File o2) {
// we have all "partial" files and there is already a merged file. Delete the data from the index
// because the merge file may not be fully merged. We will re-merge.
logger.warn("Merged Journal File {} already exists; however, all partial journal files also exist "
+ "so assuming that the merge did not finish. Repeating procedure in order to ensure consistency.");
+ "so assuming that the merge did not finish. Repeating procedure in order to ensure consistency.", suggestedMergeFile);

final DeleteIndexAction deleteAction = new DeleteIndexAction(this, indexConfig, getIndexManager());
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,13 @@ private void insertIndexDirectory(final File indexDirectory) {
// We didn't find the old index directory. Just add the new index directory.
final long timestamp = DirectoryUtils.getIndexTimestamp(indexDirectory);
if (timestamp < 0) {
logger.debug("Attempted to replace old index directory {} with new index directory {} but the old index directory did not " +
"exist and could not determine timestamp for new index directory");
logger.debug("Attempted to replace old index directory {} with new index directory but the old index directory did not " +
"exist and could not determine timestamp for new index directory", indexDirectory);
} else {
final String partitionName = getPartitionName(indexDirectory);
if (partitionName == null) {
logger.debug("Attempted to replace old index directory {} with new index directory {} but the old index directory did not " +
"exist and could not determine partition name for new index directory");
logger.debug("Attempted to replace old index directory {} with new index directory but the old index directory did not " +
"exist and could not determine partition name for new index directory", indexDirectory);
} else {
final IndexLocation indexLocation = new IndexLocation(indexDirectory, timestamp, partitionName);
indexLocationByTimestamp.computeIfAbsent(timestamp, key -> new ArrayList<>()).add(indexLocation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Arrays;

@Configuration
public class CustomFlywayConfiguration implements FlywayConfigurationCustomizer {
Expand All @@ -58,13 +59,13 @@ public void customize(final FluentConfiguration configuration) {
LOGGER.info("Determined database type is {}", databaseType.getName());

if (databaseType.equals(new MySQLDatabaseType())) {
LOGGER.info("Setting migration locations to {}", LOCATIONS_MYSQL);
LOGGER.info("Setting migration locations to {}", Arrays.asList(LOCATIONS_MYSQL));
configuration.locations(LOCATIONS_MYSQL);
} else if (databaseType.equals(new PostgreSQLDatabaseType())) {
LOGGER.info("Setting migration locations to {}", LOCATIONS_POSTGRES);
LOGGER.info("Setting migration locations to {}", Arrays.asList(LOCATIONS_POSTGRES));
configuration.locations(LOCATIONS_POSTGRES);
} else {
LOGGER.info("Setting migration locations to {}", LOCATIONS_DEFAULT);
LOGGER.info("Setting migration locations to {}", Arrays.asList(LOCATIONS_DEFAULT));
configuration.locations(LOCATIONS_DEFAULT);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void handle(final Event event) {
try {
builder.start();
} catch (IOException e) {
LOGGER.error("Execution of {0} failed with: {1}", new Object[] { commandString, e.getLocalizedMessage() }, e);
LOGGER.error("Command Execution Failed: {}", commandString, e);
}
}

Expand Down Expand Up @@ -93,7 +93,7 @@ public void onConfigured(ProviderConfigurationContext configurationContext) thro

scriptFile = new File(scripPath);
if(scriptFile.isFile() && scriptFile.canExecute()) {
LOGGER.info("Configured ScriptEventHookProvider with script {}", new Object[] {scriptFile.getAbsolutePath()});
LOGGER.info("Configured ScriptEventHookProvider with script {}", scriptFile.getAbsolutePath());
} else {
throw new ProviderCreationException("The script file " + scriptFile.getAbsolutePath() + " cannot be executed.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public UserAndGroups getUserAndGroups(String identity) throws AuthorizationAcces
compositeUserAndGroups.setUser(userAndGroups.getUser());
providerClassForUser = userGroupProvider.getClass().getName();
} else {
logger.warn("Multiple UserGroupProviders are claiming to provide user '{}': [{} and {}] ",
logger.warn("Multiple UserGroupProviders are claiming to provide identity [{}] user '{}': [{} and {}] ",
identity,
userAndGroups.getUser(),
providerClassForUser, userGroupProvider.getClass().getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public UserGroup deleteUserGroup(final String identifier) {

final Group group = userGroupProvider.getGroup(identifier);
if (group == null) {
LOGGER.warn("The specified user group id [{}] does not exist.", group.getIdentifier());
LOGGER.warn("The specified user group id [{}] does not exist.", identifier);
throw new ResourceNotFoundException("The specified user group ID does not exist in this registry.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private static List<IdentityMapping> getMappings(final NiFiRegistryProperties pr
final String identityPattern = properties.getProperty(propertyName);

if (StringUtils.isBlank(identityPattern)) {
LOGGER.warn("{} Mapping property {} was found, but was empty", new Object[] {getSubject.get(), propertyName});
LOGGER.warn("{} Mapping property {} was found, but was empty", getSubject.get(), propertyName);
continue;
}

Expand All @@ -98,15 +98,15 @@ private static List<IdentityMapping> getMappings(final NiFiRegistryProperties pr

if (StringUtils.isBlank(identityValue)) {
LOGGER.warn("{} Mapping property {} was found, but corresponding value {} was not found",
new Object[]{propertyName, identityValueProperty});
getSubject.get(), propertyName, identityValueProperty);
continue;
}

final String identityTransformProperty = transformPrefix + key;
String rawIdentityTransform = properties.getProperty(identityTransformProperty);

if (StringUtils.isBlank(rawIdentityTransform)) {
LOGGER.debug("{} Mapping property {} was found, but no transform was present. Using NONE.", new Object[] {getSubject.get(), propertyName});
LOGGER.debug("{} Mapping property {} was found, but no transform was present. Using NONE.", getSubject.get(), propertyName);
rawIdentityTransform = IdentityMapping.Transform.NONE.name();
}

Expand All @@ -115,15 +115,15 @@ private static List<IdentityMapping> getMappings(final NiFiRegistryProperties pr
identityTransform = Transform.valueOf(rawIdentityTransform);
} catch (final IllegalArgumentException iae) {
LOGGER.warn("{} Mapping property {} was found, but corresponding transform {} was not valid. Allowed values {}",
new Object[] {getSubject.get(), propertyName, rawIdentityTransform, StringUtils.join(Transform.values(), ", ")});
getSubject.get(), propertyName, rawIdentityTransform, StringUtils.join(Transform.values(), ", "));
continue;
}

final IdentityMapping identityMapping = new IdentityMapping(key, Pattern.compile(identityPattern), identityValue, identityTransform);
mappings.add(identityMapping);

LOGGER.debug("Found {} Mapping with key = {}, pattern = {}, value = {}, transform = {}",
new Object[] {getSubject.get(), key, identityPattern, identityValue, rawIdentityTransform});
getSubject.get(), key, identityPattern, identityValue, rawIdentityTransform);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public AuthType getAuthType() {
private static final String AUTHORIZATION = "Authorization";
private static final String AUTHORIZATION_NEGOTIATE = "Negotiate";

private long expiration = TimeUnit.MILLISECONDS.convert(12, TimeUnit.HOURS);;
private long expiration = TimeUnit.MILLISECONDS.convert(12, TimeUnit.HOURS);
private KerberosServiceAuthenticationProvider kerberosServiceAuthenticationProvider;
private AuthenticationDetailsSource<HttpServletRequest, ?> authenticationDetailsSource;

Expand Down Expand Up @@ -106,10 +106,6 @@ public AuthenticationRequest extractCredentials(HttpServletRequest request) {
logger.debug("Detected 'Authorization: Negotiate header in request {}", request.getRequestURL());
byte[] base64Token = headerValue.substring(headerValue.indexOf(" ") + 1).getBytes(StandardCharsets.UTF_8);
byte[] kerberosTicket = Base64.decode(base64Token);
if (kerberosTicket != null) {
logger.debug("Successfully decoded SPNEGO/Kerberos ticket passed in Authorization: Negotiate <ticket> header.", request.getRequestURL());
}

return new AuthenticationRequest(null, kerberosTicket, authenticationDetailsSource.buildDetails(request));

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public static KeyPair parseKeyPairFromReader(Reader pemKeyPairReader) throws IOE
// Already in PKCS #1 format
return getKeyPair((PEMKeyPair)parsedObject);
} else {
logger.warn("Expected one of %s or %s but got %s", PrivateKeyInfo.class, PEMKeyPair.class, parsedObject.getClass());
logger.warn("Expected one of {} or {} but got {}", PrivateKeyInfo.class, PEMKeyPair.class, parsedObject.getClass());
throw new IOException("Expected private key in PKCS #1 or PKCS #8 unencrypted format");
}
}
Expand Down