1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-25 12:27:58 +01:00

Certification toString improvements

- Detect delegations based on depth
- Add scope regexes for delegations
This commit is contained in:
Heiko Schaefer 2023-06-29 00:32:17 +02:00
parent 7e6e9274f8
commit f09ea00fdd
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -49,9 +49,11 @@ data class Certification(
this(issuer, target, targetUserId, creationTime, null, true, 120, Depth.limited(0), RegexSet.wildcard()) this(issuer, target, targetUserId, creationTime, null, true, 120, Depth.limited(0), RegexSet.wildcard())
override fun toString(): String { override fun toString(): String {
return if (userId != null) return if (trustDepth.limit == 0)
"$issuer certifies [$userId] ${target.fingerprint}" "${issuer.fingerprint} certifies binding: $userId <-> ${target.fingerprint} [$trustAmount]"
else else {
"$issuer delegates to ${target.fingerprint}" val scope = if (regexes.regexStrings.isEmpty()) "" else ", scope: $regexes"
"${issuer.fingerprint} delegates to ${target.fingerprint} [$trustAmount, depth $trustDepth$scope]"
}
} }
} }