Skip to content

refactor(dgw): move the session store out of the credential module - #1893

Merged
irvingouj@Devolutions (irvingoujAtDevolution) merged 2 commits into
masterfrom
feat/provisioning-store
Jul 31, 2026
Merged

refactor(dgw): move the session store out of the credential module#1893
irvingouj@Devolutions (irvingoujAtDevolution) merged 2 commits into
masterfrom
feat/provisioning-store

Conversation

@irvingoujAtDevolution

@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This PR is mechanical, migrate the credentials name to provision, with a some relocation of code to provisioning.rs

State(DgwState {
conf_handle,
sessions,
credentials,

@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasoning:

Provisioning starting to exhibit sementics exceeding more than just credential.
For this PR stack, we will starting to have KDC server as provisioned value, which is by discussion, not part of credential. Hence we repalced it and use more generic term, provisioning as store.

@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) force-pushed the feat/provisioning-store branch 2 times, most recently from fc64469 to 0cdff84 Compare July 29, 2026 19:36
@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) changed the title refactor(dgw): give provisioning its own store and target options type refactor(dgw): move the session store out of the credential module Jul 29, 2026
@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) marked this pull request as ready for review July 30, 2026 15:15
Copilot AI review requested due to automatic review settings July 30, 2026 15:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Moves credential/token provisioning storage into a dedicated module while preserving existing service behavior.

Changes:

  • Adds the provisioning module and relocates store types, errors, and cleanup.
  • Updates credential injection, preflight, and task wiring.
  • Adjusts related documentation and tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
devolutions-gateway/src/service.rs Registers the relocated cleanup task.
devolutions-gateway/src/provisioning.rs Defines the provisioning store and cleanup logic.
devolutions-gateway/src/lib.rs Exports the new module.
devolutions-gateway/src/credential/mod.rs Removes storage logic and exposes encryption internally.
devolutions-gateway/src/credential_injection_kdc.rs Migrates consumers and tests to the new store.
devolutions-gateway/src/api/preflight.rs Imports the relocated insertion error.
Comments suppressed due to low confidence (2)

devolutions-gateway/src/credential/mod.rs:70

  • This intra-doc link is unresolved because ProvisioningStore is in a sibling module and is not in this module's scope. Qualify the path so the generated API documentation links to the moved method.
/// Passwords are encrypted on write. Hand this directly to [`ProvisioningStore::insert`].

devolutions-gateway/src/credential_injection_kdc.rs:859

  • This test comment still points to credential::cleanup_task, which no longer exists after the move. Update it to the provisioning module so it accurately describes the deterministic substitute used here.
            credentials: ProvisioningStore::new(),

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread devolutions-gateway/src/credential/mod.rs Outdated
Comment thread devolutions-gateway/src/credential_injection_kdc.rs
Comment thread devolutions-gateway/src/credential_injection_kdc.rs
Comment thread devolutions-gateway/src/lib.rs
Base automatically changed from regenerate-openapi-client to master July 31, 2026 02:02
The store keyed by association-token JTI is not credential-specific: a session can
need other things provisioned ahead of the connection, and the next commit adds the
first one. Move it to a `provisioning` module and name it for what it holds, leaving
`credential` with just the credential types.

Pure move and rename — same types, same API, same behavior. Callers follow.
Qualify ProvisioningStore doc links and update comments that still named CredentialStore/credential::cleanup_task.

@CBenoit Benoît Cortier (CBenoit) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) merged commit f2560de into master Jul 31, 2026
42 checks passed
@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) deleted the feat/provisioning-store branch July 31, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants