Class HostPasswordRotationStore
java.lang.Object
ecmwf.common.database.HostPasswordRotationStore
Persistent, secret-free state for Host password rotation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic enum -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateTested(HostPasswordRotationStore.Access access, UUID reference, String endpoint, String expectedConfiguration, HostPasswordRotationStore.LegacyCutover enrolled) activationSnapshot(HostPasswordRotationStore.Access access, UUID reference, String endpoint) admitLegacy(long host, String mover, String operation) booleanbeginDiscard(HostPasswordRotationStore.Access access, UUID reference) blockedLegacyDispatchHosts(List<Long> hosts, boolean allowUnmigrated) find(HostPasswordRotationStore.Access access) findActiveForDelivery(long host, String destination, String endpoint, String address, int port, String login) An empty result means the Host has never been activated.findActiveForDispatch(long host, HostPasswordRotationStore.ProbeHost selectedHost, String endpoint, String address, int port, String login) voidfinishDiscard(long host, UUID reference) voidbooleanmarkStaged(long host, UUID reference) prepareLegacyDrain(HostPasswordRotationStore.Access access, UUID reference, String endpoint, List<HostPasswordRotationStore.LegacyRoute> routes) reconcileLegacyAdmissions(HostPasswordRotationStore.Access access, HostPasswordRotationStore.LegacyCutover cutover) voidrecordLegacyDrainEvidence(HostPasswordRotationStore.Access access, HostPasswordRotationStore.LegacyCutover cutover, HostPasswordRotationStore.LegacyRoute route, UUID nonce, String receipt, int sessions) booleanrecordPassedProbe(long host, UUID reference, String endpoint, HostPasswordRotationStore.ProbeHost expected, String address, int port, String login) voidrequireLegacyDispatchAllowed(long host, boolean allowUnmigrated) booleanreserve(HostPasswordRotationStore.Access access, UUID reference) booleanreserve(HostPasswordRotationStore.Access access, UUID reference, long retirementGraceSeconds) reserveEligibleProbe(HostPasswordRotationStore.Access access, UUID reference) static voidvalidateRetirementGrace(long seconds)
-
Method Details
-
activationSnapshot
public HostPasswordRotationStore.ProbeHost activationSnapshot(HostPasswordRotationStore.Access access, UUID reference, String endpoint) throws IOException - Throws:
IOException
-
activateTested
public void activateTested(HostPasswordRotationStore.Access access, UUID reference, String endpoint, String expectedConfiguration, HostPasswordRotationStore.LegacyCutover enrolled) throws IOException - Throws:
IOException
-
findLegacyCutover
public Optional<HostPasswordRotationStore.LegacyCutover> findLegacyCutover(HostPasswordRotationStore.Access access) throws IOException - Throws:
IOException
-
prepareLegacyDrain
public HostPasswordRotationStore.LegacyCutover prepareLegacyDrain(HostPasswordRotationStore.Access access, UUID reference, String endpoint, List<HostPasswordRotationStore.LegacyRoute> routes) throws IOException - Throws:
IOException
-
recordLegacyDrainEvidence
public void recordLegacyDrainEvidence(HostPasswordRotationStore.Access access, HostPasswordRotationStore.LegacyCutover cutover, HostPasswordRotationStore.LegacyRoute route, UUID nonce, String receipt, int sessions) throws IOException - Throws:
IOException
-
reconcileLegacyAdmissions
public HostPasswordRotationStore.LegacyDrainProgress reconcileLegacyAdmissions(HostPasswordRotationStore.Access access, HostPasswordRotationStore.LegacyCutover cutover) throws IOException - Throws:
IOException
-
legacyDrainProgress
public HostPasswordRotationStore.LegacyDrainProgress legacyDrainProgress(HostPasswordRotationStore.Access access) throws IOException - Throws:
IOException
-
reserveEligibleProbe
public HostPasswordRotationStore.ProbeHost reserveEligibleProbe(HostPasswordRotationStore.Access access, UUID reference) throws IOException - Throws:
IOException
-
findActiveForDelivery
public Optional<UUID> findActiveForDelivery(long host, String destination, String endpoint, String address, int port, String login) throws IOException An empty result means the Host has never been activated. An activated Host whose approval no longer matches must fail delivery rather than use its legacy password.- Throws:
IOException
-
findActiveForDispatch
public Optional<UUID> findActiveForDispatch(long host, HostPasswordRotationStore.ProbeHost selectedHost, String endpoint, String address, int port, String login) throws IOException - Throws:
IOException
-
requireLegacyDispatchAllowed
- Throws:
IOException
-
blockedLegacyDispatchHosts
public Set<Long> blockedLegacyDispatchHosts(List<Long> hosts, boolean allowUnmigrated) throws IOException - Throws:
IOException
-
admitLegacy
public HostPasswordRotationStore.LegacyAdmission admitLegacy(long host, String mover, String operation) throws IOException - Throws:
IOException
-
finishLegacy
- Throws:
IOException
-
reserve
- Throws:
IOException
-
reserve
public boolean reserve(HostPasswordRotationStore.Access access, UUID reference, long retirementGraceSeconds) throws IOException - Throws:
IOException
-
validateRetirementGrace
public static void validateRetirementGrace(long seconds) -
find
public Optional<HostPasswordRotationStore.Pending> find(HostPasswordRotationStore.Access access) throws IOException - Throws:
IOException
-
markStaged
- Throws:
IOException
-
recordPassedProbe
public boolean recordPassedProbe(long host, UUID reference, String endpoint, HostPasswordRotationStore.ProbeHost expected, String address, int port, String login) throws IOException - Throws:
IOException
-
beginDiscard
public boolean beginDiscard(HostPasswordRotationStore.Access access, UUID reference) throws IOException - Throws:
IOException
-
finishDiscard
- Throws:
IOException
-