Skip to content

Commit dd69701

Browse files
irvingoujAtDevolutionCBenoit
authored andcommitted
docs(dgw): describe the provisioning view by its contract, not its caller
Reword the `ProvisionedConnection` and `ProvisioningStore::get` docs to state the contract (credentials required, connection options optional, TTL lifetime) instead of naming the RDP credential-injection caller, which overfits and goes stale as soon as another consumer appears.
1 parent 6b937cc commit dd69701

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

devolutions-gateway/src/provisioning.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ use uuid::Uuid;
1010
use crate::credential::{AppCredentials, CleartextAppCredentials};
1111
use crate::target_connection_options::TargetConnectionOptions;
1212

13-
/// A combined, point-in-time view of everything provisioned for a session.
13+
/// A combined, point-in-time view of everything provisioned for a session, assembled on read from
14+
/// the two independent stores.
1415
///
15-
/// Assembled on read from the two independent stores. Credentials are required by the only consumer
16-
/// today (RDP credential injection); connection options are optional and may be absent — never
16+
/// Credentials are always present; connection options are optional and may be absent — never
1717
/// provisioned, or expired before the credentials half.
1818
#[derive(Debug, Clone)]
1919
pub(crate) struct ProvisionedConnection {
@@ -94,12 +94,13 @@ impl ProvisioningStore {
9494
self.connection_options.lock().insert(jti, entry).is_some()
9595
}
9696

97-
/// Combined view for the RDP credential-injection path.
97+
/// Assemble the provisioned view for a session.
9898
///
99-
/// Requires the credentials half and folds in the connection-options half when it is present.
100-
/// Entries live until their TTL, not until first use: a jti names a session, and the token layer
101-
/// allows an RDP session to open several connections (reconnects), each of which needs the same
102-
/// materials. Either half is treated as absent once expired; the cleanup task reclaims them.
99+
/// Returns `None` unless the credentials half is present and live; folds in the connection-options
100+
/// half when it too is present. Entries live until their TTL, not until first use: a jti names a
101+
/// session, and the token layer allows several connections per session (reconnects), each of which
102+
/// needs the same materials. Either half is treated as absent once expired; the cleanup task
103+
/// reclaims them.
103104
pub(crate) fn get(&self, jti: Uuid) -> Option<ProvisionedConnection> {
104105
let now = time::OffsetDateTime::now_utc();
105106

0 commit comments

Comments
 (0)