Tabnine Logo
EntityImpersonator
Code IndexAdd Tabnine to your IDE (free)

How to use
EntityImpersonator
in
co.cask.cdap.security.impersonation

Best Java code snippets using co.cask.cdap.security.impersonation.EntityImpersonator (Showing top 19 results out of 315)

origin: co.cask.cdap/cdap-app-fabric

private Instantiators(ArtifactDescriptor parentArtifactDescriptor) throws Exception {
 // todo : shouldn't pass null, should use ArtifactId instead of ArtifactDescriptor so we have namespace.
 this.parentClassLoader =
  authArtifactRepository.createArtifactClassLoader(
   // todo : should not pass null, (Temporary)
   // change Instantiators to accept ArtifactId instead of ArtifactDescriptor
   parentArtifactDescriptor.getLocation(), new EntityImpersonator(null, impersonator));
 this.instantiatorInfoMap = new ConcurrentHashMap<>();
 this.pluginDir = DirUtils.createTempDir(stageDir);
}
origin: cdapio/cdap

private Location copyFileToDestination(final Id.Artifact artifactId,
                    File artifactContent,
                    EntityImpersonator entityImpersonator) throws Exception {
 return entityImpersonator.impersonate(() -> copyFile(artifactId, artifactContent));
}
origin: co.cask.cdap/cdap-app-fabric

new EntityImpersonator(artifactId.toEntityId(), impersonator).impersonate(new Callable<Void>() {
 @Override
 public Void call() throws Exception {
origin: cdapio/cdap

new EntityImpersonator(artifactId.toEntityId(), impersonator).impersonate(new Callable<Void>() {
 @Override
 public Void call() throws Exception {
origin: cdapio/cdap

private Instantiators(ArtifactDescriptor parentArtifactDescriptor) throws Exception {
 // todo : shouldn't pass null, should use ArtifactId instead of ArtifactDescriptor so we have namespace.
 this.parentClassLoader =
  authArtifactRepository.createArtifactClassLoader(
   // todo : should not pass null, (Temporary)
   // change Instantiators to accept ArtifactId instead of ArtifactDescriptor
   parentArtifactDescriptor.getLocation(), new EntityImpersonator(null, impersonator));
 this.instantiatorInfoMap = new ConcurrentHashMap<>();
 this.pluginDir = DirUtils.createTempDir(stageDir);
}
origin: co.cask.cdap/cdap-app-fabric

private Location copyFileToDestination(final Id.Artifact artifactId,
                    final InputSupplier<? extends InputStream> artifactContentSupplier,
                    EntityImpersonator entityImpersonator) throws Exception {
 return entityImpersonator.impersonate(() -> copyFile(artifactId, artifactContentSupplier));
}
origin: cdapio/cdap

EntityImpersonator entityImpersonator = new EntityImpersonator(artifactId.toEntityId(),
                                impersonator);
if (!parentArtifacts.isEmpty()) {
origin: cdapio/cdap

                       EntityImpersonator entityImpersonator) throws IOException {
try {
 final File unpackDir = entityImpersonator.impersonate(new Callable<File>() {
  @Override
  public File call() throws IOException {
origin: co.cask.cdap/cdap-app-fabric

EntityImpersonator entityImpersonator = new EntityImpersonator(artifactId.toEntityId(),
                                impersonator);
if (!parentArtifacts.isEmpty()) {
origin: co.cask.cdap/cdap-app-fabric

                       EntityImpersonator entityImpersonator) throws IOException {
try {
 final File unpackDir = entityImpersonator.impersonate(new Callable<File>() {
  @Override
  public File call() throws IOException {
origin: cdapio/cdap

 private void writeArtifact(Id.Artifact artifactId, ArtifactMeta meta, String contents)
  throws ArtifactAlreadyExistsException, IOException, WriteConflictException {

  File artifactFile = TEMP_FOLDER.newFile();
  Files.write(artifactFile.toPath(), Bytes.toBytes(contents));

  artifactStore.write(artifactId, meta, artifactFile,
            new EntityImpersonator(artifactId.toEntityId(),
                        new DefaultImpersonator(CConfiguration.create(), null)));
 }
}
origin: cdapio/cdap

final File unpackDir = entityImpersonator.impersonate(new Callable<File>() {
 @Override
 public File call() throws IOException {
origin: cdapio/cdap

@Test(expected = InvalidArtifactException.class)
public void testInvalidConfigApp() throws Exception {
 Manifest manifest = new Manifest();
 File appFile =
  createJar(InvalidConfigApp.class, new File(TMP_FOLDER.newFolder(), "InvalidConfigApp-1.0.0.jar"), manifest);
 Id.Artifact artifactId = Id.Artifact.from(Id.Namespace.DEFAULT, "InvalidConfigApp", "1.0.0");
 Location artifactLocation = Locations.toLocation(appFile);
 try (CloseableClassLoader artifactClassLoader =
     classLoaderFactory.createClassLoader(
      ImmutableList.of(artifactLocation).iterator(),
      new EntityImpersonator(artifactId.toEntityId(), new DefaultImpersonator(CConfiguration.create(), null)))) {
  artifactInspector.inspectArtifact(artifactId, appFile, artifactClassLoader);
 }
}
origin: co.cask.cdap/cdap-app-fabric

final File unpackDir = entityImpersonator.impersonate(new Callable<File>() {
 @Override
 public File call() throws IOException {
origin: cdapio/cdap

classLoaderFactory.createClassLoader(
 ImmutableList.of(artifactLocation).iterator(),
 new EntityImpersonator(artifactId.toEntityId(), new DefaultImpersonator(CConfiguration.create(), null)))) {
origin: cdapio/cdap

    appJar, new EntityImpersonator(artifactId.getNamespace().toEntityId(),
                   new DefaultImpersonator(cConf, null)))) {
Configurator configuratorWithConfig =
origin: cdapio/cdap

 new EntityImpersonator(artifactId, impersonator);
ClassLoader artifactClassLoader = artifactRepository.createArtifactClassLoader(artifactLocation,
                                        classLoaderImpersonator);
origin: co.cask.cdap/cdap-app-fabric

 new EntityImpersonator(artifactId, impersonator);
ClassLoader artifactClassLoader = artifactRepository.createArtifactClassLoader(artifactLocation,
                                        classLoaderImpersonator);
origin: cdapio/cdap

    appJar, new EntityImpersonator(artifactId.getNamespace().toEntityId(),
                   new DefaultImpersonator(cConf, null)))) {
Configurator configurator = new InMemoryConfigurator(conf, Id.Namespace.DEFAULT, artifactId,
co.cask.cdap.security.impersonationEntityImpersonator

Javadoc

Delegates to impersonator's doAs, but uses the namespace passed during initialization.

Most used methods

  • <init>
  • impersonate

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • compareTo (BigDecimal)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JLabel (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now