/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* 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
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/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 packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle 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]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/**
* Represents a security Principal, identified using an SSL cert, that is
* authorized to perform admin operations. Used both to identify the DAS and instances
* to each other and also for any end-user cert that should be accepted as
* authorization for admin operations.
*
*/
/**
* Sets the DN of the SecureAdminPrincipal
*
* @param dn the DN
*/
/**
* Gets the distinguished name for this SecureAdminPrincipal
*
* @return {@link String } containing the DN
*/
/**
* Invoked during creation of a new SecureAdminPrincipal.
*/
@Inject(/*name=CREATION_DECORATOR_NAME*/)
private boolean isAlias = true;
public void decorate(AdminCommandContext context, SecureAdminPrincipal instance) throws TransactionFailure, PropertyVetoException {
try {
/*
* The user might have specified an alias, so delegate to the
* helper to return the DN for that alias (or the DN if that's
* what the user specified).
*/
}
}
}
/**
* Resolves using the type and any name, with no restrictions on the name and
* with an optional mapping from a cert alias to the name.
* <p>
* The similar {@link TypeAndNameResolver} restricts the name to one that excludes
* commas, because TypeAndNameResolver uses habitat.getComponent which
* (ultimately) uses habitat.getInhabitantByContract which splits the name using
* a comma to get a list of names to try to match against.
* <p>
* In some cases the name might actually contain a comma, so this resolver
* supports those cases.
* <p>
* This resolver also allows the caller to specify an alias instead of the
* name (the DN) itself, in which case the resolver maps the alias to the
* corresponding cert's DN and uses that as the name.
*
* @author Tim Quinn
*/
private boolean isAlias = true;
final protected static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(SecureAdminPrincipal.class);
/*
* First, convert the alias to the DN (if the name is an alias).
*/
try {
throw new RuntimeException(ex);
}
"SecureAdminPrincipalResolver.configTypeNotNamed",
throw new IllegalArgumentException(msg);
}
/*
* Look among all instances of this contract type for a match on the
* full name.
*/
return candidate;
}
}
"SecureAdminPrincipalResolver.target_object_not_found",
throw new RuntimeException(msg);
}
}
}