mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8191139: Remove deprecated javax.security.auth.Policy API
Reviewed-by: mullan
This commit is contained in:
parent
68b1b6c580
commit
50484af54b
6 changed files with 6 additions and 1795 deletions
File diff suppressed because it is too large
Load diff
|
@ -51,13 +51,6 @@ import sun.net.www.ParseUtil;
|
|||
* This class represents a default Policy implementation for the
|
||||
* "JavaPolicy" type.
|
||||
*
|
||||
* Note:
|
||||
* For backward compatibility with JAAS 1.0 it loads
|
||||
* both java.auth.policy and java.policy. However, it
|
||||
* is recommended that java.auth.policy not be used
|
||||
* and that java.policy contain all grant entries including
|
||||
* those that contain principal-based entries.
|
||||
*
|
||||
* <p> This object stores the policy for the entire Java runtime,
|
||||
* and is the amalgamation of multiple static policy
|
||||
* configurations that resides in files.
|
||||
|
@ -75,17 +68,13 @@ import sun.net.www.ParseUtil;
|
|||
* are needed in order for the runtime to operate correctly.
|
||||
* <li>
|
||||
* Loop through the <code>java.security.Security</code> properties,
|
||||
* <i>policy.url.1</i>, <i>policy.url.2</i>, ...,
|
||||
* <i>policy.url.X</i>" and
|
||||
* <i>auth.policy.url.1</i>, <i>auth.policy.url.2</i>, ...,
|
||||
* <i>auth.policy.url.X</i>". These properties are set
|
||||
* and <i>policy.url.1</i>, <i>policy.url.2</i>, ...,
|
||||
* <i>policy.url.X</i>". These properties are set
|
||||
* in the Java security properties file, which is located in the file named
|
||||
* <JAVA_HOME>/conf/security/java.security.
|
||||
* Each property value specifies a <code>URL</code> pointing to a
|
||||
* policy file to be loaded. Read in and load each policy.
|
||||
*
|
||||
* <i>auth.policy.url</i> is supported only for backward compatibility.
|
||||
*
|
||||
* If none of these could be loaded, use a builtin static policy
|
||||
* equivalent to the conf/security/java.policy file.
|
||||
*
|
||||
|
@ -98,21 +87,7 @@ import sun.net.www.ParseUtil;
|
|||
* <i>policy.allowSystemProperty</i> is set to <i>true</i>),
|
||||
* also load that policy.
|
||||
*
|
||||
* <li>
|
||||
* The <code>java.lang.System</code> property
|
||||
* <i>java.security.auth.policy</i> may also be set to a
|
||||
* <code>URL</code> pointing to another policy file
|
||||
* (which is the case when a user uses the -D switch at runtime).
|
||||
* If this property is defined, and its use is allowed by the
|
||||
* security property file (the Security property,
|
||||
* <i>policy.allowSystemProperty</i> is set to <i>true</i>),
|
||||
* also load that policy.
|
||||
*
|
||||
* <i>java.security.auth.policy</i> is supported only for backward
|
||||
* compatibility.
|
||||
*
|
||||
* If the <i>java.security.policy</i> or
|
||||
* <i>java.security.auth.policy</i> property is defined using
|
||||
* If the <i>java.security.policy</i> property is defined using
|
||||
* "==" (rather than "="), then load the specified policy file and ignore
|
||||
* all other configured policies. Note, that the default.policy file is
|
||||
* also loaded, as specified in the first step of the algorithm above.
|
||||
|
@ -269,8 +244,6 @@ public class PolicyFile extends java.security.Policy {
|
|||
"javax.security.auth.x500.X500Principal";
|
||||
private static final String POLICY = "java.security.policy";
|
||||
private static final String POLICY_URL = "policy.url.";
|
||||
private static final String AUTH_POLICY = "java.security.auth.policy";
|
||||
private static final String AUTH_POLICY_URL = "auth.policy.url.";
|
||||
|
||||
private static final int DEFAULT_CACHE_SIZE = 1;
|
||||
|
||||
|
@ -411,14 +384,6 @@ public class PolicyFile extends java.security.Policy {
|
|||
/**
|
||||
* Caller did not specify URL via Policy.getInstance.
|
||||
* Read from URLs listed in the java.security properties file.
|
||||
*
|
||||
* We call initPolicyFile with POLICY, POLICY_URL and then
|
||||
* call it with AUTH_POLICY and AUTH_POLICY_URL.
|
||||
* So first we will process the JAVA standard policy
|
||||
* and then process the JAVA AUTH Policy.
|
||||
* This is for backward compatibility as well as to handle
|
||||
* cases where the user has a single unified policyfile
|
||||
* with both java policy entries and auth entries
|
||||
*/
|
||||
|
||||
boolean loaded_one = initPolicyFile(POLICY, POLICY_URL, newInfo);
|
||||
|
@ -428,8 +393,6 @@ public class PolicyFile extends java.security.Policy {
|
|||
// use static policy if all else fails
|
||||
initStaticPolicy(newInfo);
|
||||
}
|
||||
|
||||
initPolicyFile(AUTH_POLICY, AUTH_POLICY_URL, newInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -150,11 +150,6 @@ public class Resources extends java.util.ListResourceBundle {
|
|||
// sun.security.pkcs11.SunPKCS11
|
||||
{"PKCS11.Token.providerName.Password.",
|
||||
"PKCS11 Token [{0}] Password: "},
|
||||
|
||||
/* --- DEPRECATED --- */
|
||||
// javax.security.auth.Policy
|
||||
{"unable.to.instantiate.Subject.based.policy",
|
||||
"unable to instantiate Subject-based policy"}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue