Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b028483
feat: add signed chat file download URLs
ibetitsmike Aug 17, 2026
1ab93d9
test: cover signed chat file download URLs
ibetitsmike Aug 17, 2026
ddfb2b6
feat(codersdk/toolsdk): add chat file download, await, list, and forw…
ibetitsmike Aug 17, 2026
692109e
test(codersdk/toolsdk): cover MCP chat UAT evidence tools
ibetitsmike Aug 17, 2026
ce867a0
refactor(coderd): simplify signed chat file download internals
ibetitsmike Aug 17, 2026
77699e6
fix(codersdk/toolsdk): handle shared-chat awaits and file-only messages
ibetitsmike Aug 17, 2026
942a333
fix(codersdk/toolsdk): survive watch stream drops and emit final forw…
ibetitsmike Aug 17, 2026
4a7a27a
fix: tolerate watch dial failures in await and seed chat_files_token …
ibetitsmike Aug 17, 2026
e3b1a8a
fix(codersdk/toolsdk): bound await by wait_secs during watch dial and…
ibetitsmike Aug 17, 2026
06175e2
fix(codersdk/toolsdk): bound every await status request by the wait w…
ibetitsmike Aug 17, 2026
3ea17e6
docs(codersdk/toolsdk): document search and diff_url chat query fields
ibetitsmike Aug 17, 2026
85e69e1
fix(coderd): disable caching on signed chat file downloads
ibetitsmike Aug 17, 2026
b1f3c3a
fix: hide experimental download routes from API docs and recheck awai…
ibetitsmike Aug 18, 2026
9691a1f
fix: harden chat file signed downloads and MCP tool contracts
ibetitsmike Aug 18, 2026
93d24f7
fix: enforce await wait_secs bound and guard trace spans against quer…
ibetitsmike Aug 18, 2026
fb86d94
fix(coderd/database/migrations): renumber chat files token migration …
ibetitsmike Aug 18, 2026
1788ef9
docs(codersdk/toolsdk): document quoting for colon-containing query v…
ibetitsmike Aug 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

109 changes: 109 additions & 0 deletions coderd/apidoc/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ type Options struct {
AppSigningKeyCache cryptokeys.SigningKeycache
AppEncryptionKeyCache cryptokeys.EncryptionKeycache
OIDCConvertKeyCache cryptokeys.SigningKeycache
ChatFileTokenKeyCache cryptokeys.SigningKeycache
// NATSCACache serves the NATS cluster mTLS CA via the generic signing key
// cache for the nats_ca feature. SigningKey returns the active CA
// (a *NATSCA); VerifyingKey returns a specific CA by sequence. The key
Expand Down Expand Up @@ -593,6 +594,17 @@ func New(options *Options) *API {
}
}

if options.ChatFileTokenKeyCache == nil {
options.ChatFileTokenKeyCache, err = cryptokeys.NewSigningCache(ctx,
options.Logger.Named("chat_file_token_keycache"),
fetcher,
codersdk.CryptoKeyFeatureChatFilesToken,
)
if err != nil {
options.Logger.Fatal(ctx, "failed to properly instantiate chat file token signing cache", slog.Error(err))
}
}

if options.AppSigningKeyCache == nil {
options.AppSigningKeyCache, err = cryptokeys.NewSigningCache(ctx,
options.Logger.Named("app_signing_keycache"),
Expand Down Expand Up @@ -1359,6 +1371,10 @@ func New(options *Options) *API {
r.Delete("/", api.deleteUserAIProviderKey)
})
})
r.Group(func(r chi.Router) {
r.Use(httpmw.RateLimit(options.FilesRateLimit, time.Minute))
r.Get("/chats/files/{file}/download", api.downloadChatFile)
})
r.Route("/chats", func(r chi.Router) {
r.Use(
apiKeyMiddleware,
Expand All @@ -1371,6 +1387,7 @@ func New(options *Options) *API {
r.Route("/files", func(r chi.Router) {
r.Use(httpmw.RateLimit(options.FilesRateLimit, time.Minute))
r.Post("/", api.postChatFile)
r.Post("/{file}/download-url", api.postChatFileDownloadURL)
r.Get("/{file}", api.chatFileByID)
})
r.Route("/config", func(r chi.Router) {
Expand Down Expand Up @@ -2493,6 +2510,7 @@ func (api *API) Close() error {
}
_ = api.NetworkTelemetryBatcher.Close()
_ = api.OIDCConvertKeyCache.Close()
_ = api.ChatFileTokenKeyCache.Close()
_ = api.AppSigningKeyCache.Close()
_ = api.AppEncryptionKeyCache.Close()
if api.NATSCACache != nil {
Expand Down
2 changes: 2 additions & 0 deletions coderd/coderdtest/coderdtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ type Options struct {
NotificationsEnqueuer notifications.Enqueuer
APIKeyEncryptionCache cryptokeys.EncryptionKeycache
OIDCConvertKeyCache cryptokeys.SigningKeycache
ChatFileTokenKeyCache cryptokeys.SigningKeycache
Clock quartz.Clock
Acquirer *provisionerdserver.Acquirer
TelemetryReporter telemetry.Reporter
Expand Down Expand Up @@ -693,6 +694,7 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can
Acquirer: options.Acquirer,
AppEncryptionKeyCache: options.APIKeyEncryptionCache,
OIDCConvertKeyCache: options.OIDCConvertKeyCache,
ChatFileTokenKeyCache: options.ChatFileTokenKeyCache,
ProvisionerdServerMetrics: options.ProvisionerdServerMetrics,
WorkspaceBuilderMetrics: options.WorkspaceBuilderMetrics,
}
Expand Down
2 changes: 1 addition & 1 deletion coderd/cryptokeys/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func isEncryptionKeyFeature(feature codersdk.CryptoKeyFeature) bool {

func isSigningKeyFeature(feature codersdk.CryptoKeyFeature) bool {
switch feature {
case codersdk.CryptoKeyFeatureTailnetResume, codersdk.CryptoKeyFeatureOIDCConvert, codersdk.CryptoKeyFeatureWorkspaceAppsToken, codersdk.CryptoKeyFeatureNATSCA:
case codersdk.CryptoKeyFeatureTailnetResume, codersdk.CryptoKeyFeatureOIDCConvert, codersdk.CryptoKeyFeatureChatFilesToken, codersdk.CryptoKeyFeatureWorkspaceAppsToken, codersdk.CryptoKeyFeatureNATSCA:
return true
default:
return false
Expand Down
Loading
Loading