Repository navigation
Move executor credentials, installations and file writes into sessions and sessionpg - #341
Merged
Merged
Conversation
…s and sessionpg Executor credential issuance, rotation and revocation, for the CLI principal and for a Project's self_hosted Environment, are sessions.Service use cases: sessions checks the principal, target and archived Project and decides each outcome, and sessionpg applies it in one transaction. The Core-key Project operations record their administrator audit entry in that transaction. ProjectExecutorCredentialState joins sessions.ExecutorCredentialReader, and api reads it through EnvironmentsReader. Native installation authorization, validation and claim are sessions use cases, and the pooled sessionpg.Store signs and verifies installation tokens with the credential key; without one they are credentialcrypto.ErrUnavailable, which validation and claim return unchanged. The executor credentials contract and the OpenAPI documents list the resulting 503 credential_storage_unavailable on the grant routes, the Core-key installation read and the self_hosted Session retrieve and update. cmd/environment-key builds a keyless Session service. File-write reservation and settlement join EnvironmentExecution on sessionpg.NewExecution(lease): each loads, decides and applies in one leased Session transaction, and the write-audit source is stored with the intent and recorded when the write commits. The Worker runs them through the Session execution operations. sessionpg's loadSessionEnvironment is no longer a participant of other adapters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executor credential issuance, rotation and revocation, native Environment installation and Environment file writes move out of
storeintosessionsandsessionpg. This completes PR 17; #336 moved Environments and devices.What changes
Executor credentials:
sessions.Serviceuse cases for:sessionpgapplies them. The Core-key Project operations record their admin audit entry in the same transaction. The Project credential state is a reader method, which api reads throughEnvironmentsReader.Native installation: Authorize, Validate and Claim are
sessionsuse cases.sessionsbuilds and parses the token, andsessionpg.Storesigns and verifies it with the credential key, so the key stays in the adapter. The token format and signature are unchanged, so tokens issued before this change still verify.File writes: reservation and settlement are lease-bound
ExecutionOperations(theEnvironmentExecutionfamily). The file-write lookup is internal tosessionpg.Wiring:
cmd/environment-keybuilds a keyless Session service and no longer importsstore.Removed from
store:environment_installation.goenvironment_executor_credentials.goexecutor_credential_target.goenvironment_executor_management.goenvironment_file_writes.goListProjectExecutorCredentialsDocs:
IMPLEMENTATION.mdnames the new owners.sessionpg.LoadSessionEnvironmenthad no external caller, so it is unexported.Behavior
credential_storage_unavailable.self_hostedSession.Checks
go build ./...,go vet ./services/core/...,make openapi(the committed diff is only the response codes above) andscripts/check-names.py.sessionsandsessionpgin full.-runon the touched tests: 46 pass, including the official-client andenvironment-keybinary tests.-runon the Environment, installation, executor and error-mapping tests.-run 'Environment|FileWrite'.cmd/environment-keyandcmd/serverin full.The blind review found no blockers or majors. Its three minor findings are fixed in this commit: the undocumented 503, an overclaim about which operations are audited, and a stale comment.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.