congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SubmoduleValidator
Code IndexAdd Tabnine to your IDE (free)

How to use
SubmoduleValidator
in
org.eclipse.jgit.internal.submodule

Best Java code snippets using org.eclipse.jgit.internal.submodule.SubmoduleValidator (Showing top 8 results out of 315)

origin: org.eclipse.jgit/org.eclipse.jgit

private void checkSubmodules()
    throws IOException {
  ObjectDatabase odb = db.getObjectDatabase();
  if (objectChecker == null) {
    return;
  }
  for (GitmoduleEntry entry : objectChecker.getGitsubmodules()) {
    AnyObjectId blobId = entry.getBlobId();
    ObjectLoader blob = odb.open(blobId, Constants.OBJ_BLOB);
    try {
      SubmoduleValidator.assertValidGitModulesFile(
          new String(blob.getBytes(), UTF_8));
    } catch (LargeObjectException | SubmoduleValidationException e) {
      throw new IOException(e);
    }
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

for (String subsection :
    c.getSubsections(CONFIG_SUBMODULE_SECTION)) {
  assertValidSubmoduleName(subsection);
    assertValidSubmoduleUri(url);
      CONFIG_SUBMODULE_SECTION, subsection, CONFIG_KEY_PATH);
  if (path != null) {
    assertValidSubmodulePath(path);
origin: org.eclipse.jgit/org.eclipse.jgit

  SubmoduleValidator.assertValidSubmoduleName(name);
  SubmoduleValidator.assertValidSubmodulePath(path);
  SubmoduleValidator.assertValidSubmoduleUri(uri);
} catch (SubmoduleValidator.SubmoduleValidationException e) {
  throw new IllegalArgumentException(e.getMessage());
origin: org.eclipse.jgit/org.eclipse.jgit

private void checkGitModules(ProgressMonitor pm, FsckError errors)
    throws IOException {
  pm.beginTask(JGitText.get().validatingGitModules,
      objChecker.getGitsubmodules().size());
  for (GitmoduleEntry entry : objChecker.getGitsubmodules()) {
    AnyObjectId blobId = entry.getBlobId();
    ObjectLoader blob = objdb.open(blobId, Constants.OBJ_BLOB);
    try {
      SubmoduleValidator.assertValidGitModulesFile(
          new String(blob.getBytes(), UTF_8));
    } catch (SubmoduleValidationException e) {
      CorruptObject co = new FsckError.CorruptObject(
          blobId.toObjectId(), Constants.OBJ_BLOB,
          e.getFsckMessageId());
      errors.getCorruptObjects().add(co);
    }
    pm.update(1);
  }
  pm.endTask();
}
origin: berlam/github-bucket

for (String subsection :
    c.getSubsections(CONFIG_SUBMODULE_SECTION)) {
  assertValidSubmoduleName(subsection);
    assertValidSubmoduleUri(url);
      CONFIG_SUBMODULE_SECTION, subsection, CONFIG_KEY_PATH);
  if (path != null) {
    assertValidSubmodulePath(path);
origin: berlam/github-bucket

private void checkSubmodules()
    throws IOException {
  ObjectDatabase odb = db.getObjectDatabase();
  if (objectChecker == null) {
    return;
  }
  for (GitmoduleEntry entry : objectChecker.getGitsubmodules()) {
    AnyObjectId blobId = entry.getBlobId();
    ObjectLoader blob = odb.open(blobId, Constants.OBJ_BLOB);
    try {
      SubmoduleValidator.assertValidGitModulesFile(
          new String(blob.getBytes(), UTF_8));
    } catch (LargeObjectException | SubmoduleValidationException e) {
      throw new IOException(e);
    }
  }
}
origin: berlam/github-bucket

  SubmoduleValidator.assertValidSubmoduleName(name);
  SubmoduleValidator.assertValidSubmodulePath(path);
  SubmoduleValidator.assertValidSubmoduleUri(uri);
} catch (SubmoduleValidator.SubmoduleValidationException e) {
  throw new IllegalArgumentException(e.getMessage());
origin: berlam/github-bucket

private void checkGitModules(ProgressMonitor pm, FsckError errors)
    throws IOException {
  pm.beginTask(JGitText.get().validatingGitModules,
      objChecker.getGitsubmodules().size());
  for (GitmoduleEntry entry : objChecker.getGitsubmodules()) {
    AnyObjectId blobId = entry.getBlobId();
    ObjectLoader blob = objdb.open(blobId, Constants.OBJ_BLOB);
    try {
      SubmoduleValidator.assertValidGitModulesFile(
          new String(blob.getBytes(), UTF_8));
    } catch (SubmoduleValidationException e) {
      CorruptObject co = new FsckError.CorruptObject(
          blobId.toObjectId(), Constants.OBJ_BLOB,
          e.getFsckMessageId());
      errors.getCorruptObjects().add(co);
    }
    pm.update(1);
  }
  pm.endTask();
}
org.eclipse.jgit.internal.submoduleSubmoduleValidator

Javadoc

Validations for the git submodule fields (name, path, uri). Invalid values in these fields can cause security problems as reported in CVE-2018-11235 and and CVE-2018-17456

Most used methods

  • assertValidGitModulesFile
    Validate a .gitmodules file
  • assertValidSubmoduleName
    Validate name for a submodule
  • assertValidSubmodulePath
    Validate path for a submodule
  • assertValidSubmoduleUri
    Validate URI for a submodule

Popular in Java

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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