Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Payara/payara into PAYARA…
Browse files Browse the repository at this point in the history
…-3111-admin-audit-servic
  • Loading branch information
Cousjava committed Apr 25, 2019
2 parents 2f2dbf9 + 7b6ec8f commit 0790757
Show file tree
Hide file tree
Showing 271 changed files with 8,055 additions and 2,913 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

<!--
Describe the test to reproduce the bug in a series of steps. Make each step simple to follow by describing configuration changes, commands to run or simple instructions; for example:
If possible it is always preferred if you host a test case as a maven project on Github that simply demonstrates the issue.
If this is not appropriate then describe the test to reproduce the bug in a series of steps. Make each step simple to follow by describing configuration changes, commands to run or simple instructions; for example:
1 -** Start the domain
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ target/
.idea
.DS_Store
gfbuild.log
/nucleus/payara-modules/requesttracing-core/nbproject/
nb-configuration.xml
/appserver/tests/quicklook/classes/
/appserver/tests/quicklook/dist/
/appserver/tests/quicklook/test-output/
/appserver/tests/quicklook/*.output
/appserver/tests/quicklook/**/*.war
*.log
/nucleus/payara-modules/nucleus-microprofile/config-service/nbproject/
appserver/extras/arquillian-containers/payara-common/dependency-reduced-pom.xml
/nucleus/payara-modules/service-exemplar/nbproject/
/nucleus/admin/server-mgmt/nbproject/
appserver/tests/quicklook/quicklook_summary.txt
**/nbproject
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved.
*
*
* Copyright (c) [2018-2019] Payara Foundation and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
Expand All @@ -11,20 +11,20 @@
* https://github.com/payara/Payara/blob/master/LICENSE.txt
* See the License for the specific
* language governing permissions and limitations under the License.
*
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at glassfish/legal/LICENSE.txt.
*
*
* GPL Classpath Exception:
* The Payara Foundation designates this particular file as subject to the "Classpath"
* exception as provided by the Payara Foundation in the GPL Version 2 section of the License
* file that accompanied this code.
*
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
Expand All @@ -46,24 +46,25 @@
/**
* Class to hold state of OpenId
* <p>
* This is used in the authentication mechanism to both help prevent CSRF and to
* This is used in the authentication mechanism to both help prevent CSRF and to
* pass data to the callback page.
*
* @author Gaurav Gupta
* @author jonathan
*/
public class OpenIdState implements Serializable {

private static final long serialVersionUID = 1L;

private final String state;


/**
* Creates a new instance with a random UUID as the state.
* Creates a new instance with a random UUID as the state.
*/
public OpenIdState(){
state = UUID.randomUUID().toString();
}

/**
* Creates a new instance set the state to what is in the constructor.
* <p>
Expand All @@ -72,23 +73,34 @@ public OpenIdState(){
* {@link fish.payara.security.openid.OpenIdAuthenticationMechanism} by
* default
*
* @param state
* @param state the state to encapsulate
*/
public OpenIdState(String state){
this.state = state;
}

/**
* Gets the state
*
* @return
* @return the state
*/
public String getValue() {
return state;
}

public boolean equals(String expectedStateValue) {
return Objects.equals(this.state, expectedStateValue);
@Override
public boolean equals(Object obj) {
if (obj instanceof String) {
return Objects.equals(this.state, obj);
} else if (obj instanceof OpenIdState) {
return Objects.equals(this.state, ((OpenIdState)obj).state);
}
return false;
}

@Override
public int hashCode() {
return Objects.hash(this.state);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* holder.
*/

// Portions Copyright [2016-2018] [Payara Foundation and/or its affiliates]
// Portions Copyright [2016-2019] [Payara Foundation and/or its affiliates]

/*
* InstanceHandler.java
Expand All @@ -58,13 +58,11 @@
import com.sun.jsftemplating.annotation.HandlerInput;
import com.sun.jsftemplating.annotation.HandlerOutput;
import com.sun.jsftemplating.layout.descriptors.handler.HandlerContext;

import java.util.Map;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;

import org.glassfish.admingui.common.util.GuiUtil;
import org.glassfish.admingui.common.util.RestUtil;

Expand Down Expand Up @@ -211,6 +209,7 @@ public static void saveLoggingAttributes(HandlerContext handlerCtx) {
key.equals("com.sun.enterprise.server.logging.GFFileHandler.multiLineMode") ||
key.equals("com.sun.enterprise.server.logging.GFFileHandler.rotationOnDateChange" ) ||
key.equals("com.sun.enterprise.server.logging.GFFileHandler.compressOnRotation") ||
key.equals("com.sun.enterprise.server.logging.GFFileHandler.logStandardStreams") ||
key.equals("fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.logtoFile") ||
key.equals("fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.rotationOnDateChange") ||
key.equals("fish.payara.enterprise.server.logging.PayaraNotificationFileHandler.compressOnRotation"))
Expand All @@ -220,7 +219,7 @@ public static void saveLoggingAttributes(HandlerContext handlerCtx) {
props.put("id", key + "='" + attrs.get(key) + "'");
props.put("target", config);
RestUtil.restRequest((String)GuiUtil.getSessionValue("REST_URL") + "/set-log-attributes",
props, "POST", null, false, true);
props, "POST", null, false, true);
}
}catch (Exception ex){
GuiUtil.handleException(handlerCtx, ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
holder.

-->
<!-- Portions Copyright [2016-2018] [Payara Foundation and/or its affiliates] -->
<!-- Portions Copyright [2016-2019] [Payara Foundation and/or its affiliates] -->

<!-- common/configuration/loggerGeneral.jsf -->

Expand Down Expand Up @@ -135,8 +135,8 @@
values={"com.sun.enterprise.server.logging.UniformLogFormatter", "com.sun.enterprise.server.logging.ODLLogFormatter", "fish.payara.enterprise.server.logging.JSONLogFormatter"} />
</sun:property>

<sun:property id="disableStdioRedirect" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nc.log.DirectStdIO}" helpText="$resource{i18nc.log.DirectStdIOHelp}">
<sun:checkbox label="$resource{i18n.common.Enabled}" selected="#{pageSession.logAttributes['fish.payara.enterprise.server.logging.stdio.disable']}" selectedValue="true"/>
<sun:property id="logStandardStreamsProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nc.log.LogStandardStreams}" helpText="$resource{i18nc.log.LogStandardStreamsHelp}">
<sun:checkbox id="logStandardStreamsEnabled" label="$resource{i18n.common.Enabled}" selected="#{pageSession.logAttributes['com.sun.enterprise.server.logging.GFFileHandler.logStandardStreams']}" selectedValue="true"/>
</sun:property>

<sun:property id="logfileFormat" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nc.log.FileLogFormat}" helpText="$resource{i18nc.log.FileLogFormatHelp}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ log.multiLineMode=Multiline Mode:
log.multiLineModeHelp=Start the log message body on a new line after the message header
log.ConsoleLogFormat=Console Logging Format:
log.ConsoleLogFormatHelp=Format for logging to the console
log.DirectStdIO=Direct System Streams:
log.DirectStdIOHelp=System.out and System.err are not redirected to logging, rather write to console directly.
log.LogStandardStreams=Log Standard Streams:
log.LogStandardStreamsHelp=When enabled, the system streams will be written to both the console and the server log file. Otherwise it will only be written to the console
log.FileLogFormat=Log File Logging Format:
log.FileLogFormatHelp=Format for logging to the server log file
log.FilePayaraNotificationLogFormatHelp=Format for logging to the Notification log file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,15 @@ public static URI getURI(final File f) throws URISyntaxException {
* @throws FileNotFoundException if the temp file cannot be opened for any reason
*/
public static File writeTextToTempFile(String content, String prefix, String suffix, boolean retainTempFiles) throws IOException, FileNotFoundException {
BufferedWriter wtr = null;
try {
File result = File.createTempFile(prefix, suffix);
if ( ! retainTempFiles) {
result.deleteOnExit();
}
FileOutputStream fos = new FileOutputStream(result);
wtr = new BufferedWriter(new OutputStreamWriter(fos));
wtr.write(content);
wtr.close();
return result;
} finally {
if (wtr != null) {
wtr.close();
}
File result = File.createTempFile(prefix, suffix);
if ( ! retainTempFiles) {
result.deleteOnExit();
}
try (BufferedWriter writer =
new BufferedWriter(new OutputStreamWriter(new FileOutputStream(result)))) {
writer.write(content);
}
return result;
}

/**
Expand Down
Loading

0 comments on commit 0790757

Please sign in to comment.