Package org.codehaus.loom.xmlpolicy.metadata

Examples of org.codehaus.loom.xmlpolicy.metadata.PermissionMetaData


    public void testMetaDataWithAPermissionAndCertsAndMisnamedPerm()
        throws Exception
    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName() + "sss", null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "jenny", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
View Full Code Here


    public void testFailureWhenCreatingKeyStore()
        throws Exception
    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName() + "sss", null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "jenny", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
View Full Code Here

    public void testFailureRetrievingCertForAlias()
        throws Exception
    {
        final PolicyBuilder builder = new TestNoInitPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName() + "sss", null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "peter", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
View Full Code Here

    public void testAliasNoExist()
        throws Exception
    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName() + "sss", null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "peter", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
View Full Code Here

    public void testNoKeyStore()
        throws Exception
    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName(), null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "peter", "default",
                               new PermissionMetaData[]{permission} );
        final PolicyMetaData metaData =
View Full Code Here

    {
        verifyKeyStoreReference( policy, grant.getKeyStore() );
        final PermissionMetaData[] permissions = grant.getPermissions();
        for( int j = 0; j < permissions.length; j++ )
        {
            final PermissionMetaData permission = permissions[ j ];
            verifyKeyStoreReference( policy, permission.getKeyStore() );
        }
    }
View Full Code Here

        {
            final GrantMetaData grant = grants[ i ];
            final PermissionMetaData[] permissions = grant.getPermissions();
            for( int j = 0; j < permissions.length; j++ )
            {
                final PermissionMetaData permission = permissions[ j ];
                final String target = permission.getTarget();
                final String action = permission.getAction();
                if( null == target && null != action )
                {
                    final String message =
                        REZ.format( "permission-missing-action.error",
                                       grant.getCodebase(),
                                       permission.getClassname() );
                    throw new Exception( message );
                }
            }
        }
    }
View Full Code Here

        final int length = elements.getLength();

        for( int i = 0; i < length; i++ )
        {
            final Element element = (Element)elements.item( i );
            final PermissionMetaData permission = buildPermission( element );
            grants.add( permission );
        }

        return (PermissionMetaData[])grants.toArray( new PermissionMetaData[ grants.size() ] );
    }
View Full Code Here

        String keyStore = getAttribute( element, "key-store" );
        if( null != signedBy && null == keyStore )
        {
            keyStore = "default";
        }
        return new PermissionMetaData( classname, target, action,
                                       signedBy, keyStore );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.loom.xmlpolicy.metadata.PermissionMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.