Top Description Inners Fields Constructors Methods
org.eclipse.jgit.internal.signing.ssh

pack-priv final Class AllowedSigners

extends ModifiableFileWatcher
Class Inheritance
Imports
java.io.BufferedReader, .IOException, .StreamCorruptedException, java.nio.charset.StandardCharsets, java.nio.file.Files, .NoSuchFileException, .Path, java.security.PublicKey, java.text.MessageFormat, java.time.Instant, .LocalDate, .LocalDateTime, .ZoneId, .ZoneOffset, java.time.format.DateTimeFormatter, .DateTimeFormatterBuilder, java.time.temporal.ChronoField, .TemporalAccessor, java.util.ArrayList, .Arrays, .Collection, .HashMap, .LinkedHashSet, .List, .Locale, .Map, .Objects, .Set, java.util.function.Predicate, java.util.stream.Collectors, org.apache.sshd.common.config.keys.KeyUtils, .OpenSshCertificate, .PublicKeyEntry, org.apache.sshd.common.util.io.ModifiableFileWatcher, org.eclipse.jgit.internal.transport.ssh.OpenSshConfigFile, org.eclipse.jgit.internal.transport.sshd.SshdText, org.eclipse.jgit.signing.ssh.VerificationException, org.eclipse.jgit.util.StringUtils, .SystemReader

Encapsulates the allowed signers handling.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static record
pack-priv static record
private static record

Field Summary

Modifier and TypeField and Description
private static final String
private static final Predicate<AllowedSigners.AllowedEntry>
private static final String
private static final Predicate<AllowedSigners.AllowedEntry>
private static final DateTimeFormatter
private AllowedSigners.State
private static final String
private static final String
Inherited from org.apache.sshd.common.util.io.ModifiableFileWatcher:
optionsSTRICTLY_PROHIBITED_FILE_PERMISSION

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static AllowedSigners.Dequoted
dequote(String line, int from)

private AllowedSigners.AllowedEntry
public String
isAllowed(PublicKey key, String namespace, String name, Instant time)

private static boolean
matches(String src, String other, int offset)

pack-priv static Instant
pack-priv static AllowedSigners.AllowedEntry
pack-priv static String
parsePublicKey(String s, int from)

private synchronized AllowedSigners.State
private static AllowedSigners.State
reload(Path path)

Inherited from org.apache.sshd.common.util.io.ModifiableFileWatcher:
checkReloadRequiredexistsgetPathlastModifiedresetReloadAttributessizetoPathResourcetoPathResourcetoStringupdateReloadAttributesvalidateStrictConfigFilePermissions

Field Detail

CERT_AUTHORITYback to summary
private static final String CERT_AUTHORITY
CERTIFICATESback to summary
private static final Predicate<AllowedSigners.AllowedEntry> CERTIFICATES
NAMESPACESback to summary
private static final String NAMESPACES
PLAIN_KEYSback to summary
private static final Predicate<AllowedSigners.AllowedEntry> PLAIN_KEYS
SSH_DATE_FORMATback to summary
private static final DateTimeFormatter SSH_DATE_FORMAT
stateback to summary
private AllowedSigners.State state
VALID_AFTERback to summary
private static final String VALID_AFTER
VALID_BEFOREback to summary
private static final String VALID_BEFORE

Constructor Detail

AllowedSignersback to summary
public AllowedSigners(Path path)

Method Detail

dequoteback to summary
pack-priv static AllowedSigners.Dequoted dequote(String line, int from)
findback to summary
private AllowedSigners.AllowedEntry find(AllowedSigners.State current, PublicKey key, String namespace, String name, Instant time, Predicate<AllowedSigners.AllowedEntry> filter) throws VerificationException
isAllowedback to summary
public String isAllowed(PublicKey key, String namespace, String name, Instant time) throws IOException, VerificationException
matchesback to summary
private static boolean matches(String src, String other, int offset)
parseDateback to summary
pack-priv static Instant parseDate(String input)
parseLineback to summary
pack-priv static AllowedSigners.AllowedEntry parseLine(String line) throws IOException
parsePublicKeyback to summary
pack-priv static String parsePublicKey(String s, int from) throws StreamCorruptedException
refreshback to summary
private synchronized AllowedSigners.State refresh() throws IOException
reloadback to summary
private static AllowedSigners.State reload(Path path) throws IOException
org.eclipse.jgit.internal.signing.ssh back to summary

pack-priv final Record AllowedSigners.AllowedEntry

extends Record
Class Inheritance
Annotations
@SuppressWarnings:ArrayRecordComponent
Record Components
identities:String[] 
isCA:boolean 
namespaces:String[] 
validAfter:Instant 
validBefore:Instant 
key:String 

Field Summary

Modifier and TypeField and Description
private final String[]
identities

Record Component accessed by identities().

private final boolean
isCA

Record Component accessed by isCA().

private final String
key

Record Component accessed by key().

private final String[]
namespaces

Record Component accessed by namespaces().

private final Instant
validAfter

Record Component accessed by validAfter().

private final Instant
validBefore

Record Component accessed by validBefore().

Constructor Summary

AccessConstructor and Description
pack-priv
AllowedEntry(String[] identities, boolean isCA, String[] namespaces, Instant validAfter, Instant validBefore, String key)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object
the reference object with which to compare.
any
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public String[]
identities()

Record Component getter of identities.

public boolean
isCA()

Record Component getter of isCA.

public String
key()

Record Component getter of key.

public String[]
namespaces()

Record Component getter of namespaces.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

public Instant
validAfter()

Record Component getter of validAfter.

public Instant
validBefore()

Record Component getter of validBefore.

Field Detail

identitiesback to summary
private final String[] identities

Record Component accessed by identities().

isCAback to summary
private final boolean isCA

Record Component accessed by isCA().

keyback to summary
private final String key

Record Component accessed by key().

namespacesback to summary
private final String[] namespaces

Record Component accessed by namespaces().

validAfterback to summary
private final Instant validAfter

Record Component accessed by validAfter().

validBeforeback to summary
private final Instant validBefore

Record Component accessed by validBefore().

Constructor Detail

AllowedEntryback to summary
pack-priv AllowedEntry(String[] identities, boolean isCA, String[] namespaces, Instant validAfter, Instant validBefore, String key)

Method Detail

equalsback to summary
public final boolean equals(Object any)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
any:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

Annotations
@Override
identitiesback to summary
public String[] identities()

Record Component getter of identities.

isCAback to summary
public boolean isCA()

Record Component getter of isCA.

keyback to summary
public String key()

Record Component getter of key.

namespacesback to summary
public String[] namespaces()

Record Component getter of namespaces.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

validAfterback to summary
public Instant validAfter()

Record Component getter of validAfter.

validBeforeback to summary
public Instant validBefore()

Record Component getter of validBefore.

org.eclipse.jgit.internal.signing.ssh back to summary

pack-priv final Record AllowedSigners.Dequoted

extends Record
Class Inheritance
Record Components
value:String 
after:int 

Field Summary

Modifier and TypeField and Description
private final int
after

Record Component accessed by after().

private final String
value

Record Component accessed by value().

Constructor Summary

AccessConstructor and Description
pack-priv
Dequoted(String value, int after)

Method Summary

Modifier and TypeMethod and Description
public int
after()

Record Component getter of after.

public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

public String
value()

Record Component getter of value.

Field Detail

afterback to summary
private final int after

Record Component accessed by after().

valueback to summary
private final String value

Record Component accessed by value().

Constructor Detail

Dequotedback to summary
pack-priv Dequoted(String value, int after)

Method Detail

afterback to summary
public int after()

Record Component getter of after.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

valueback to summary
public String value()

Record Component getter of value.

org.eclipse.jgit.internal.signing.ssh back to summary

private final Record AllowedSigners.State

extends Record
Class Inheritance
Record Components
entries:Map<String, List<AllowedSigners.AllowedEntry>> 

Field Summary

Modifier and TypeField and Description
private final Map<String, List<AllowedSigners.AllowedEntry>>
entries

Record Component accessed by entries().

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Map<String, List<AllowedSigners.AllowedEntry>>
entries()

Record Component getter of entries.

public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

entriesback to summary
private final Map<String, List<AllowedSigners.AllowedEntry>> entries

Record Component accessed by entries().

Constructor Detail

Stateback to summary
private State(Map<String, List<AllowedSigners.AllowedEntry>> entries)

Method Detail

entriesback to summary
public Map<String, List<AllowedSigners.AllowedEntry>> entries()

Record Component getter of entries.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.