1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-05 03:55:58 +01:00

Refactor package names

This commit is contained in:
Paul Schaub 2023-07-09 13:03:57 +02:00
parent 8c71afc250
commit fdd0973a0b
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
37 changed files with 91 additions and 96 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 {

View file

@ -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 {

View file

@ -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

View file

@ -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 {

View file

@ -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.

View file

@ -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 {

View file

@ -4,7 +4,7 @@
package org.pgpainless.wot.api
import org.pgpainless.wot.dijkstra.sq.Paths
import org.pgpainless.wot.query.Paths
interface ListAPI {

View file

@ -4,7 +4,7 @@
package org.pgpainless.wot.api
import org.pgpainless.wot.dijkstra.sq.Paths
import org.pgpainless.wot.query.Paths
interface LookupAPI {

View file

@ -4,7 +4,7 @@
package org.pgpainless.wot.api
import org.pgpainless.wot.dijkstra.sq.Fingerprint
import org.pgpainless.wot.network.Fingerprint
interface PathAPI {

View file

@ -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.

View file

@ -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.

View file

@ -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

View file

@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0
package org.pgpainless.wot.dijkstra.sq
package org.pgpainless.wot.network
import java.util.*

View file

@ -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> {

View file

@ -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.

View file

@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0
package org.pgpainless.wot.dijkstra.sq
package org.pgpainless.wot.network
import java.util.*

View file

@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0
package org.pgpainless.wot.dijkstra.sq
package org.pgpainless.wot.network
import java.util.*

View file

@ -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

View file

@ -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

View file

@ -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
/**

View file

@ -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].

View file

@ -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>"))
}
}

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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.*
/**

View file

@ -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

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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 {