mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-24 03:47:57 +01:00
Refactor package names
This commit is contained in:
parent
8c71afc250
commit
fdd0973a0b
37 changed files with 91 additions and 96 deletions
|
@ -11,8 +11,8 @@ import org.pgpainless.wot.KeyRingCertificateStore
|
|||
import org.pgpainless.wot.WebOfTrust
|
||||
import org.pgpainless.wot.api.WoTAPI
|
||||
import org.pgpainless.wot.cli.subcommands.*
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.ReferenceTime
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
import org.pgpainless.wot.network.ReferenceTime
|
||||
import pgp.cert_d.PGPCertificateStoreAdapter
|
||||
import pgp.cert_d.subkey_lookup.InMemorySubkeyLookupFactory
|
||||
import pgp.certificate_store.PGPCertificateStore
|
||||
|
|
|
@ -6,8 +6,8 @@ package org.pgpainless.wot.cli.subcommands
|
|||
|
||||
import org.pgpainless.wot.api.AuthenticateAPI
|
||||
import org.pgpainless.wot.cli.WotCLI
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.Path
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
import org.pgpainless.wot.query.Path
|
||||
import picocli.CommandLine
|
||||
import picocli.CommandLine.Command
|
||||
import picocli.CommandLine.Parameters
|
||||
|
|
|
@ -2,7 +2,9 @@ package org.pgpainless.wot.cli.subcommands
|
|||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.pgpainless.wot.api.AuthenticateAPI
|
||||
import org.pgpainless.wot.dijkstra.sq.*
|
||||
import org.pgpainless.wot.network.*
|
||||
import org.pgpainless.wot.query.Path
|
||||
import org.pgpainless.wot.query.Paths
|
||||
import java.text.SimpleDateFormat
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ import org.pgpainless.policy.Policy
|
|||
import org.pgpainless.signature.SignatureUtils
|
||||
import org.pgpainless.signature.consumer.SignatureVerifier
|
||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil
|
||||
import org.pgpainless.wot.dijkstra.sq.*
|
||||
import org.pgpainless.wot.dijkstra.sq.ReferenceTime.Companion.now
|
||||
import org.pgpainless.wot.network.*
|
||||
import org.pgpainless.wot.network.ReferenceTime.Companion.now
|
||||
import org.pgpainless.wot.util.CertificationFactory.Companion.fromCertification
|
||||
import org.pgpainless.wot.util.CertificationFactory.Companion.fromDelegation
|
||||
import org.slf4j.LoggerFactory
|
||||
|
|
|
@ -6,11 +6,11 @@ package org.pgpainless.wot.util
|
|||
|
||||
import org.bouncycastle.openpgp.PGPSignature
|
||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil
|
||||
import org.pgpainless.wot.dijkstra.sq.Node
|
||||
import org.pgpainless.wot.dijkstra.sq.EdgeComponent
|
||||
import org.pgpainless.wot.dijkstra.sq.Depth
|
||||
import org.pgpainless.wot.dijkstra.sq.RegexSet
|
||||
import org.pgpainless.wot.dijkstra.sq.RegexSet.Companion.fromExpressionList
|
||||
import org.pgpainless.wot.network.Node
|
||||
import org.pgpainless.wot.network.EdgeComponent
|
||||
import org.pgpainless.wot.network.Depth
|
||||
import org.pgpainless.wot.network.RegexSet
|
||||
import org.pgpainless.wot.network.RegexSet.Companion.fromExpressionList
|
||||
|
||||
class CertificationFactory {
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ import org.bouncycastle.openpgp.PGPSignature
|
|||
import org.pgpainless.algorithm.RevocationStateType
|
||||
import org.pgpainless.key.OpenPgpFingerprint
|
||||
import org.pgpainless.key.info.KeyRingInfo
|
||||
import org.pgpainless.wot.dijkstra.sq.Node
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.RevocationState
|
||||
import org.pgpainless.wot.network.Node
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
import org.pgpainless.wot.network.RevocationState
|
||||
|
||||
interface PGPDSL {
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@ package org.pgpainless.wot
|
|||
import org.bouncycastle.openpgp.PGPPublicKeyRing
|
||||
|
||||
import org.pgpainless.key.OpenPgpFingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.Edge
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.Network
|
||||
import org.pgpainless.wot.network.Edge
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
import org.pgpainless.wot.network.Network
|
||||
import org.pgpainless.wot.testfixtures.TestCertificateStores
|
||||
import org.pgpainless.wot.testfixtures.WotTestVectors
|
||||
import kotlin.test.assertEquals
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.pgpainless.key.protection.SecretKeyRingProtector
|
|||
import org.pgpainless.signature.subpackets.CertificationSubpackets
|
||||
import org.pgpainless.signature.subpackets.CertificationSubpackets.Callback
|
||||
import org.pgpainless.wot.KeyRingCertificateStore
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
import pgp.certificate_store.PGPCertificateStore
|
||||
|
||||
interface AdHocVectors {
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
package org.pgpainless.wot.api
|
||||
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.Paths
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
import org.pgpainless.wot.query.Paths
|
||||
|
||||
/**
|
||||
* Authenticate a binding.
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
package org.pgpainless.wot.api
|
||||
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.Paths
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
import org.pgpainless.wot.query.Paths
|
||||
|
||||
interface IdentifyAPI {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
package org.pgpainless.wot.api
|
||||
|
||||
import org.pgpainless.wot.dijkstra.sq.Paths
|
||||
import org.pgpainless.wot.query.Paths
|
||||
|
||||
interface ListAPI {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
package org.pgpainless.wot.api
|
||||
|
||||
import org.pgpainless.wot.dijkstra.sq.Paths
|
||||
import org.pgpainless.wot.query.Paths
|
||||
|
||||
interface LookupAPI {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
package org.pgpainless.wot.api
|
||||
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
|
||||
interface PathAPI {
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
package org.pgpainless.wot.api
|
||||
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.Network
|
||||
import org.pgpainless.wot.dijkstra.sq.ReferenceTime
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
import org.pgpainless.wot.network.Network
|
||||
import org.pgpainless.wot.network.ReferenceTime
|
||||
|
||||
/**
|
||||
* Web of Trust API, offering different operations.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
/**
|
||||
* Depth of a trust signature.
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
/**
|
||||
* An [Edge] is a set of [components][EdgeComponent] made by the same issuer, on the same
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import java.util.*
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
class Fingerprint(fingerprint: String) : Comparable<Fingerprint> {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
/**
|
||||
* A network consists of nodes, and edges between them.
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import java.util.*
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import java.util.*
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import java.util.regex.Pattern
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import java.util.*
|
||||
import kotlin.math.abs
|
|
@ -2,8 +2,11 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.query
|
||||
|
||||
import org.pgpainless.wot.network.Depth
|
||||
import org.pgpainless.wot.network.EdgeComponent
|
||||
import org.pgpainless.wot.network.Node
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra.sq
|
||||
package org.pgpainless.wot.query
|
||||
|
||||
/**
|
||||
* List of individual [Paths][Path].
|
|
@ -1,25 +0,0 @@
|
|||
package org.pgpainless.wot.dijkstra.sq
|
||||
|
||||
import kotlin.test.Test
|
||||
|
||||
class RegexSetTest {
|
||||
|
||||
@Test
|
||||
fun simpleMatch() {
|
||||
val stringList: List<String> = listOf("<[^>]+[@.]foobank\\.com>$")
|
||||
val rs = RegexSet.fromExpressionList(stringList);
|
||||
|
||||
assert(rs.matches("Foo Bank Employee <employee@foobank.com>"))
|
||||
assert(rs.matches("<employee@foobank.com>"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun simpleNonMatch() {
|
||||
val stringList: List<String> = listOf("<[^>]+[@.]foobank\\.com>$")
|
||||
val rs = RegexSet.fromExpressionList(stringList);
|
||||
|
||||
assert(!rs.matches("Bar Bank Employee <employee@barbank.com>"))
|
||||
assert(!rs.matches("<employee@barbank.com>"))
|
||||
}
|
||||
|
||||
}
|
|
@ -2,14 +2,13 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.assertThrows
|
||||
import org.pgpainless.wot.dijkstra.sq.Depth
|
||||
import org.pgpainless.wot.dijkstra.sq.Depth.Companion.auto
|
||||
import org.pgpainless.wot.dijkstra.sq.Depth.Companion.limited
|
||||
import org.pgpainless.wot.dijkstra.sq.Depth.Companion.unconstrained
|
||||
import org.pgpainless.wot.network.Depth.Companion.auto
|
||||
import org.pgpainless.wot.network.Depth.Companion.limited
|
||||
import org.pgpainless.wot.network.Depth.Companion.unconstrained
|
||||
import kotlin.test.*
|
||||
|
||||
class DepthTest {
|
|
@ -1,10 +1,10 @@
|
|||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.pgpainless.wot.dijkstra.sq.Node
|
||||
import org.pgpainless.wot.dijkstra.sq.EdgeComponent
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.RevocationState
|
||||
import org.pgpainless.wot.network.Node
|
||||
import org.pgpainless.wot.network.EdgeComponent
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
import org.pgpainless.wot.network.RevocationState
|
||||
import java.util.*
|
||||
import kotlin.test.assertEquals
|
||||
|
|
@ -2,11 +2,10 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.assertThrows
|
||||
import org.pgpainless.wot.dijkstra.sq.*
|
||||
import java.util.*
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
|
@ -1,7 +1,7 @@
|
|||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.network.Fingerprint
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertFalse
|
||||
|
|
@ -2,9 +2,8 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import org.pgpainless.wot.dijkstra.sq.*
|
||||
import java.util.*
|
||||
|
||||
/**
|
|
@ -2,13 +2,11 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.pgpainless.wot.dijkstra.sq.Fingerprint
|
||||
import org.pgpainless.wot.dijkstra.sq.Network.Companion.empty
|
||||
import org.pgpainless.wot.dijkstra.sq.ReferenceTime.Companion.now
|
||||
import org.pgpainless.wot.dijkstra.sq.RegexSet
|
||||
import org.pgpainless.wot.network.Network.Companion.empty
|
||||
import org.pgpainless.wot.network.ReferenceTime.Companion.now
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import kotlin.test.assertEquals
|
|
@ -1,7 +1,6 @@
|
|||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.pgpainless.wot.dijkstra.sq.RegexSet
|
||||
import kotlin.test.assertFalse
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
|
@ -10,6 +9,24 @@ class RegexSetTest: NetworkDSL {
|
|||
private val exampleComRegex = "<[^>]+[@.]example\\.com>\$"
|
||||
private val pgpainlessOrgRegex = "<[^>]+[@.]pgpainless\\.org>\$"
|
||||
|
||||
@Test
|
||||
fun simpleMatch() {
|
||||
val stringList: List<String> = listOf("<[^>]+[@.]foobank\\.com>$")
|
||||
val rs = RegexSet.fromExpressionList(stringList);
|
||||
|
||||
assert(rs.matches("Foo Bank Employee <employee@foobank.com>"))
|
||||
assert(rs.matches("<employee@foobank.com>"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun simpleNonMatch() {
|
||||
val stringList: List<String> = listOf("<[^>]+[@.]foobank\\.com>$")
|
||||
val rs = RegexSet.fromExpressionList(stringList);
|
||||
|
||||
assert(!rs.matches("Bar Bank Employee <employee@barbank.com>"))
|
||||
assert(!rs.matches("<employee@barbank.com>"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `verify that the wildcard RegexSet matches anything`() {
|
||||
val wildcard = RegexSet.wildcard()
|
|
@ -1,8 +1,8 @@
|
|||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.network
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.pgpainless.wot.dijkstra.sq.ReferenceTime
|
||||
import org.pgpainless.wot.dijkstra.sq.RevocationState
|
||||
import org.pgpainless.wot.network.ReferenceTime
|
||||
import org.pgpainless.wot.network.RevocationState
|
||||
import java.util.*
|
||||
import kotlin.test.assertFalse
|
||||
import kotlin.test.assertTrue
|
|
@ -1,8 +1,10 @@
|
|||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.query
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.assertThrows
|
||||
import org.pgpainless.wot.dijkstra.sq.*
|
||||
import org.pgpainless.wot.network.Depth
|
||||
import org.pgpainless.wot.network.NetworkDSL
|
||||
import org.pgpainless.wot.query.Path
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
package org.pgpainless.wot.dijkstra
|
||||
package org.pgpainless.wot.query
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.assertThrows
|
||||
import org.pgpainless.wot.dijkstra.sq.*
|
||||
import org.pgpainless.wot.network.Depth
|
||||
import org.pgpainless.wot.network.NetworkDSL
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class PathsTest: NetworkDSL {
|
Loading…
Reference in a new issue