mirror of
https://github.com/corda/corda.git
synced 2025-04-07 11:27:01 +00:00
Remove deregisterIdentity()
Remove the ability to remove registered identities. Once registered, identities are part of a permanent record (for example you would want to ensure parties to contracts cannot "disappear" by removing themselves from the identity service).
This commit is contained in:
parent
652e3a80e9
commit
c8865c1b40
@ -10,7 +10,11 @@ import java.security.PublicKey
|
||||
*/
|
||||
interface IdentityService {
|
||||
fun registerIdentity(party: Party)
|
||||
fun deregisterIdentity(party: Party)
|
||||
|
||||
// There is no method for removing identities, as once we are made aware of a Party we want to keep track of them
|
||||
// indefinitely. It may be that in the long term we need to drop or archive very old Party information for space,
|
||||
// but for now this is not supported.
|
||||
|
||||
fun partyFromKey(key: PublicKey): Party?
|
||||
fun partyFromName(name: String): Party?
|
||||
}
|
||||
|
@ -17,10 +17,7 @@ class InMemoryIdentityService() : IdentityService {
|
||||
keyToParties[party.owningKey] = party
|
||||
nameToParties[party.name] = party
|
||||
}
|
||||
override fun deregisterIdentity(party: Party) {
|
||||
keyToParties.remove(party.owningKey)
|
||||
nameToParties.remove(party.name)
|
||||
}
|
||||
|
||||
override fun partyFromKey(key: PublicKey): Party? = keyToParties[key]
|
||||
override fun partyFromName(name: String): Party? = nameToParties[name]
|
||||
}
|
@ -19,7 +19,6 @@ class MockIdentityService(val identities: List<Party>) : IdentityService {
|
||||
get() = synchronized(identities) { identities.associateBy { it.name } }
|
||||
|
||||
override fun registerIdentity(party: Party) { throw UnsupportedOperationException() }
|
||||
override fun deregisterIdentity(party: Party) { throw UnsupportedOperationException() }
|
||||
override fun partyFromKey(key: PublicKey): Party? = keyToParties[key]
|
||||
override fun partyFromName(name: String): Party? = nameToParties[name]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user