pnuts.security
Class JAASPnutsImpl

java.lang.Object
  extended by pnuts.lang.Runtime
      extended by pnuts.lang.PnutsImpl
          extended by pnuts.ext.ImplementationAdapter
              extended by pnuts.security.SecurePnutsImpl
                  extended by pnuts.security.JAASPnutsImpl
All Implemented Interfaces:
Executable, Implementation

public class JAASPnutsImpl
extends SecurePnutsImpl

A SecurePnutsImpl subclass that executes scripts with permissions constructed from codesource-based policy and subject-based policy.

e.g.
  context.setImplementation(new JAASPnutsImpl(context.Implementation(), codesource, subject))
 


Nested Class Summary
 
Nested classes/interfaces inherited from class pnuts.lang.Runtime
Runtime.Accessor, Runtime.Break, Runtime.Continue, Runtime.FunctionSerializer, Runtime.TypeMap
 
Field Summary
 
Fields inherited from class pnuts.lang.PnutsImpl
properties
 
Fields inherited from class pnuts.lang.Runtime
BOOLEAN_SYMBOL, BYTE_SYMBOL, CHAR_SYMBOL, CLONE, DOUBLE_SYMBOL, EXCEPTOIN_FIELD_SYMBOL, FLOAT_SYMBOL, INT_SYMBOL, LONG_SYMBOL, SHORT_SYMBOL, VOID_SYMBOL
 
Constructor Summary
JAASPnutsImpl(Implementation impl)
          A Constructor
JAASPnutsImpl(Implementation impl, java.security.CodeSource codeSource)
          A Constructor
JAASPnutsImpl(Implementation impl, java.security.CodeSource codeSource, javax.security.auth.Subject subject)
          A Constructor
JAASPnutsImpl(PnutsImpl impl)
          Deprecated. replaced by JAASPnutsImpl(Implementation)
JAASPnutsImpl(PnutsImpl impl, java.security.CodeSource codeSource)
          Deprecated. replaced byte JAASPnutsImpl(Implementation, CodeSource)
JAASPnutsImpl(PnutsImpl impl, java.security.CodeSource codeSource, javax.security.auth.Subject subject)
          Deprecated. replaced by JAASPnutsImpl(Implementation, CodeSource, Subject)
 
Method Summary
protected  java.security.PermissionCollection getPermissions(java.security.CodeSource codesource)
          Returns permissions from policy file, plus Applet's sand-box permissions.
 java.lang.String toString()
           
 
Methods inherited from class pnuts.security.SecurePnutsImpl
accept, addSandBoxPermissions, eval, getPolicyPermissions, load, load, loadFile
 
Methods inherited from class pnuts.ext.ImplementationAdapter
getBaseImpl
 
Methods inherited from class pnuts.lang.PnutsImpl
getDefault, popFile, provide, pushFile, queryProperty, revoke, setProperties, setProperty
 
Methods inherited from class pnuts.lang.Runtime
_callConstructor, _callMethod, add, add, add1, add1, addImport, addStaticMembers, and, and, applyGenerator, arraydim, arrayType, call, call, callConstructor, callFunction, callMethod, cast, catchException, checkException, checkException, compareObjects, compareTo, compareTo, createList, createMap, defineTopLevelFunction, defineUnboundFunction, divide, divide, eq, eq, escape, exec, execute, fileToURL, findCallableMethod, format, format, ge, ge, getArrayLength, getBeanProperty, getBeanProperty, getBeanProperty, getBeanPropertyType, getBeginColumn, getBeginLine, getBottomType, getCompiledScript, getConstructors, getElement, getElementAt, getEndLine, getField, getField, getFunction, getFunction, getFunctions, getMessage, getMethods, getProperty, getRange, getRuntime, getScriptReader, getScriptSource, getScriptURL, getStaticField, getThreadContext, gt, gt, isArray, isGenerator, jump, le, le, loadNode, lt, lt, makeArray, matchType, mod, mod, multiply, multiply, ne, ne, negate, negate, newInstance, not, not, or, or, parseChar, parseFloat, parseInt, parseString, primitive, printError, putField, putStaticField, quantity, replaceChar, run, saveNode, setBeanProperty, setBeanProperty, setBeanProperty, setElement, setExitHook, setLine, setLine, setPackage, setRange, setThreadContext, shiftArithmetic, shiftArithmetic, shiftLeft, shiftLeft, shiftRight, shiftRight, subtract, subtract, subtract1, subtract1, throwException, toBoolean, toEnumeration, transform, transform, unparse, xor, xor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JAASPnutsImpl

public JAASPnutsImpl(PnutsImpl impl)
Deprecated. replaced by JAASPnutsImpl(Implementation)

A Constructor

Parameters:
impl - a PnutsImpl object

JAASPnutsImpl

public JAASPnutsImpl(Implementation impl)
A Constructor

Parameters:
impl - a Implementation object

JAASPnutsImpl

public JAASPnutsImpl(PnutsImpl impl,
                     java.security.CodeSource codeSource)
Deprecated. replaced byte JAASPnutsImpl(Implementation, CodeSource)

A Constructor

Parameters:
impl - the base implementation
codeSource - a CodeSource object which indicates the source of the expression execute by eval(String, Context).

JAASPnutsImpl

public JAASPnutsImpl(Implementation impl,
                     java.security.CodeSource codeSource)
A Constructor

Parameters:
impl - the base implementation
codeSource - a CodeSource object which indicates the source of the expression execute by eval(String, Context).

JAASPnutsImpl

public JAASPnutsImpl(PnutsImpl impl,
                     java.security.CodeSource codeSource,
                     javax.security.auth.Subject subject)
Deprecated. replaced by JAASPnutsImpl(Implementation, CodeSource, Subject)

A Constructor

Parameters:
impl - the base implementation
codeSource - a CodeSource object which indicates the source of the expression execute by eval(String, Context).
subject - a Subject

JAASPnutsImpl

public JAASPnutsImpl(Implementation impl,
                     java.security.CodeSource codeSource,
                     javax.security.auth.Subject subject)
A Constructor

Parameters:
impl - the base implementation
codeSource - a CodeSource object which indicates the source of the expression execute by eval(String, Context).
subject - a Subject
Method Detail

getPermissions

protected java.security.PermissionCollection getPermissions(java.security.CodeSource codesource)
Description copied from class: SecurePnutsImpl
Returns permissions from policy file, plus Applet's sand-box permissions. A subclass may override this method to define a custom security policy.

Overrides:
getPermissions in class SecurePnutsImpl
Parameters:
codesource - the CodeSource of the script
Returns:
the PermissionCollection for the script

toString

public java.lang.String toString()
Overrides:
toString in class SecurePnutsImpl