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

  • Making http post requests using okhttp
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • JOptionPane (javax.swing)
  • Join (org.hibernate.mapping)
  • Top 15 Vim Plugins
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