diff --git a/README.md b/README.md index f0f07429..33a036ea 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,8 @@ This branch is built on: | | | |---|---| | Supported gateways | `0.1.x` | -| Tested on | `0.1.6` | -| OpenShell Go SDK | `v0.0.0-20261027154453-ac7f615cd12d` | +| Tested on | `0.1.9` | +| OpenShell Go SDK | `v0.1.9` | [docs/compatibility.md](docs/compatibility.md) says what the dashboard shows when the gateway is on another line, and how the claim is tested. diff --git a/backend/cmd/server/gateway_setup.go b/backend/cmd/server/gateway_setup.go index e9b98f75..67d608bf 100644 --- a/backend/cmd/server/gateway_setup.go +++ b/backend/cmd/server/gateway_setup.go @@ -6,7 +6,7 @@ import ( "os" "strings" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/clients" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/go.mod b/backend/go.mod index fff0286c..ebaf67fd 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -3,18 +3,18 @@ module github.com/ai-openshell/console/backend go 1.26.7 require ( - github.com/NVIDIA/OpenShell/sdk/go v0.0.0-20261027154453-ac7f615cd12d + github.com/ai-openshell/sdk-go v0.1.9 github.com/go-chi/chi/v5 v5.3.1 github.com/gorilla/websocket v1.5.3 - google.golang.org/grpc v1.83.2 - google.golang.org/protobuf v1.36.11 + google.golang.org/grpc v1.85.0 + google.golang.org/protobuf v1.36.12 ) require ( - golang.org/x/net v0.58.0 // indirect - golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sync v0.22.0 // indirect - golang.org/x/sys v0.47.0 // indirect - golang.org/x/text v0.41.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/oauth2 v0.37.0 // indirect + golang.org/x/sync v0.25.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260817212433-ac3dfec99bb1 // indirect ) diff --git a/backend/go.sum b/backend/go.sum index c539b2ae..db633783 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -1,56 +1,32 @@ -github.com/NVIDIA/OpenShell/sdk/go v0.0.0-20261027154453-ac7f615cd12d h1:U8hBMlpcfJ0+yUXOix5uV6DIt0W1rhvSIY7IB5PknYk= -github.com/NVIDIA/OpenShell/sdk/go v0.0.0-20261027154453-ac7f615cd12d/go.mod h1:+wnjuZwBJH2yz8cU1t7FiGK7xPQyxjOY3YZNFcfpL90= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/ai-openshell/sdk-go v0.1.9 h1:/BuirPOwpBCkSa9irdGripOjozJs8XxFLPxWIaIHwmQ= +github.com/ai-openshell/sdk-go v0.1.9/go.mod h1:kHP0ECzOyRj5InNKRJpl4zouk8OeJVa8iN4Wga968L4= github.com/go-chi/chi/v5 v5.3.1 h1:3j4HZLGZQ3JpMCrPJF/Jl3mYJfWLKBfNJ6quurUGCf8= github.com/go-chi/chi/v5 v5.3.1/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto= -github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= -github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= -github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= -go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= -go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= -go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= -go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= -go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= -go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= -go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= -go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= -go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= -go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= -golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= -golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= -golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= -golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= -golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= -golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= -golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= -golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/oauth2 v0.37.0 h1:JUlcxA8oAtauLfiH8FX2/FkAWHAdi0QtGCGc+hofE98= +golang.org/x/oauth2 v0.37.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58= +golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs= +golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= -google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= -google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= -google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= -google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260817212433-ac3dfec99bb1 h1:utmqiUzZAEINbLmRyAt1QjVkMyLQ+lvIwCpLaB1rZfw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260817212433-ac3dfec99bb1/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.85.0 h1:BPBCfuVRQ1qvBhKDOq9uvQllMvO59rKsYhXpp7Dd8vw= +google.golang.org/grpc v1.85.0/go.mod h1:0rQrOD58yjal/0EaVbGBANindixsCZNQPDV3VKtaKuQ= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/backend/pkg/apiutils/respond.go b/backend/pkg/apiutils/respond.go index 4b70e69e..32649471 100644 --- a/backend/pkg/apiutils/respond.go +++ b/backend/pkg/apiutils/respond.go @@ -9,7 +9,7 @@ import ( "net/http" "regexp" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/backend/pkg/apiutils/respond_ext_test.go b/backend/pkg/apiutils/respond_ext_test.go index e0b30e17..1f7439f0 100644 --- a/backend/pkg/apiutils/respond_ext_test.go +++ b/backend/pkg/apiutils/respond_ext_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/backend/pkg/clients/rawexec.go b/backend/pkg/clients/rawexec.go index 5149c2b3..d29d6fe1 100644 --- a/backend/pkg/clients/rawexec.go +++ b/backend/pkg/clients/rawexec.go @@ -11,7 +11,7 @@ import ( "os" "strings" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" diff --git a/backend/pkg/clients/rawexec_test.go b/backend/pkg/clients/rawexec_test.go index 8e423d3f..9e30f9ac 100644 --- a/backend/pkg/clients/rawexec_test.go +++ b/backend/pkg/clients/rawexec_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials/insecure" diff --git a/backend/pkg/clients/rawlogs.go b/backend/pkg/clients/rawlogs.go index bd13da07..e481585f 100644 --- a/backend/pkg/clients/rawlogs.go +++ b/backend/pkg/clients/rawlogs.go @@ -3,7 +3,7 @@ package clients import ( "context" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "google.golang.org/grpc" ) diff --git a/backend/pkg/clients/rawprofile.go b/backend/pkg/clients/rawprofile.go index 326c8914..ec6851eb 100644 --- a/backend/pkg/clients/rawprofile.go +++ b/backend/pkg/clients/rawprofile.go @@ -6,8 +6,8 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - dm "github.com/NVIDIA/OpenShell/sdk/go/proto/datamodelv1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + dm "github.com/ai-openshell/sdk-go/proto/datamodelv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" ) // The methods in this file read and write provider profiles as the gateway's diff --git a/backend/pkg/clients/rawprofile_test.go b/backend/pkg/clients/rawprofile_test.go index b184e88a..fcded5c1 100644 --- a/backend/pkg/clients/rawprofile_test.go +++ b/backend/pkg/clients/rawprofile_test.go @@ -7,9 +7,9 @@ import ( "sync" "testing" - dm "github.com/NVIDIA/OpenShell/sdk/go/proto/datamodelv1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" - sbv1 "github.com/NVIDIA/OpenShell/sdk/go/proto/sandboxv1" + dm "github.com/ai-openshell/sdk-go/proto/datamodelv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" + sbv1 "github.com/ai-openshell/sdk-go/proto/sandboxv1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" diff --git a/backend/pkg/clients/rawprovider.go b/backend/pkg/clients/rawprovider.go index e6920e68..aaa4a277 100644 --- a/backend/pkg/clients/rawprovider.go +++ b/backend/pkg/clients/rawprovider.go @@ -5,8 +5,8 @@ import ( "errors" "slices" - dm "github.com/NVIDIA/OpenShell/sdk/go/proto/datamodelv1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + dm "github.com/ai-openshell/sdk-go/proto/datamodelv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" ) // The methods in this file read which credentials a provider holds, which the diff --git a/backend/pkg/clients/rawprovider_allworkspaces.go b/backend/pkg/clients/rawprovider_allworkspaces.go index 1b061e0e..bb33a934 100644 --- a/backend/pkg/clients/rawprovider_allworkspaces.go +++ b/backend/pkg/clients/rawprovider_allworkspaces.go @@ -3,8 +3,8 @@ package clients import ( "context" - dm "github.com/NVIDIA/OpenShell/sdk/go/proto/datamodelv1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + dm "github.com/ai-openshell/sdk-go/proto/datamodelv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" ) // ListProviderCredentialKeysAllWorkspaces returns the keys of the credentials diff --git a/backend/pkg/clients/rawprovider_allworkspaces_test.go b/backend/pkg/clients/rawprovider_allworkspaces_test.go index 2bb38642..60b27a07 100644 --- a/backend/pkg/clients/rawprovider_allworkspaces_test.go +++ b/backend/pkg/clients/rawprovider_allworkspaces_test.go @@ -7,8 +7,8 @@ import ( "sync" "testing" - dm "github.com/NVIDIA/OpenShell/sdk/go/proto/datamodelv1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + dm "github.com/ai-openshell/sdk-go/proto/datamodelv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/backend/pkg/clients/rawprovider_test.go b/backend/pkg/clients/rawprovider_test.go index a0949bf1..4d0c3703 100644 --- a/backend/pkg/clients/rawprovider_test.go +++ b/backend/pkg/clients/rawprovider_test.go @@ -7,8 +7,8 @@ import ( "sync" "testing" - dm "github.com/NVIDIA/OpenShell/sdk/go/proto/datamodelv1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + dm "github.com/ai-openshell/sdk-go/proto/datamodelv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/backend/pkg/handlers/allworkspaces_handler.go b/backend/pkg/handlers/allworkspaces_handler.go index 6d22bd32..ca3c987d 100644 --- a/backend/pkg/handlers/allworkspaces_handler.go +++ b/backend/pkg/handlers/allworkspaces_handler.go @@ -3,7 +3,7 @@ package handlers import ( "net/http" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/handlers/allworkspaces_handler_test.go b/backend/pkg/handlers/allworkspaces_handler_test.go index 589184f8..cceb7ba4 100644 --- a/backend/pkg/handlers/allworkspaces_handler_test.go +++ b/backend/pkg/handlers/allworkspaces_handler_test.go @@ -12,8 +12,8 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/backend/pkg/handlers/drafts_handler.go b/backend/pkg/handlers/drafts_handler.go index 9928e548..81af13d9 100644 --- a/backend/pkg/handlers/drafts_handler.go +++ b/backend/pkg/handlers/drafts_handler.go @@ -8,7 +8,7 @@ import ( "sync" "time" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/handlers/drafts_handler_test.go b/backend/pkg/handlers/drafts_handler_test.go index 6945fa77..42bc8dc8 100644 --- a/backend/pkg/handlers/drafts_handler_test.go +++ b/backend/pkg/handlers/drafts_handler_test.go @@ -10,10 +10,10 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - sdktypes "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" "github.com/ai-openshell/console/backend/pkg/models" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + sdktypes "github.com/ai-openshell/sdk-go/openshell/v1/types" ) // draftRoutes mounts the draft routes on the paths app.go gives them. diff --git a/backend/pkg/handlers/drafts_summary_handler_test.go b/backend/pkg/handlers/drafts_summary_handler_test.go index ecb4d2e5..754deeca 100644 --- a/backend/pkg/handlers/drafts_summary_handler_test.go +++ b/backend/pkg/handlers/drafts_summary_handler_test.go @@ -14,7 +14,7 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/handlers/files_download_handler_test.go b/backend/pkg/handlers/files_download_handler_test.go index c2c36cd6..71de4631 100644 --- a/backend/pkg/handlers/files_download_handler_test.go +++ b/backend/pkg/handlers/files_download_handler_test.go @@ -14,9 +14,9 @@ import ( "github.com/go-chi/chi/v5" chimiddleware "github.com/go-chi/chi/v5/middleware" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) // loginShellNoise is what a sandbox under the base policy prints on stderr diff --git a/backend/pkg/handlers/files_handler.go b/backend/pkg/handlers/files_handler.go index ee99af77..26bac20c 100644 --- a/backend/pkg/handlers/files_handler.go +++ b/backend/pkg/handlers/files_handler.go @@ -15,9 +15,9 @@ import ( "time" "unicode/utf8" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) const defaultUploadDir = "/sandbox" diff --git a/backend/pkg/handlers/files_handler_test.go b/backend/pkg/handlers/files_handler_test.go index e34c5206..0f4c548a 100644 --- a/backend/pkg/handlers/files_handler_test.go +++ b/backend/pkg/handlers/files_handler_test.go @@ -13,8 +13,8 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) func TestValidateFilePath(t *testing.T) { diff --git a/backend/pkg/handlers/files_upload_handler_test.go b/backend/pkg/handlers/files_upload_handler_test.go index a3cde182..bf89f658 100644 --- a/backend/pkg/handlers/files_upload_handler_test.go +++ b/backend/pkg/handlers/files_upload_handler_test.go @@ -16,9 +16,9 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) func TestValidRelativePath(t *testing.T) { diff --git a/backend/pkg/handlers/gateway_handler_test.go b/backend/pkg/handlers/gateway_handler_test.go index 7ac7236e..68c86d85 100644 --- a/backend/pkg/handlers/gateway_handler_test.go +++ b/backend/pkg/handlers/gateway_handler_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/auth" diff --git a/backend/pkg/handlers/list_pagination.go b/backend/pkg/handlers/list_pagination.go index 031aa15e..eabfdbb6 100644 --- a/backend/pkg/handlers/list_pagination.go +++ b/backend/pkg/handlers/list_pagination.go @@ -4,7 +4,7 @@ import ( "net/http" "strconv" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" ) diff --git a/backend/pkg/handlers/list_pagination_test.go b/backend/pkg/handlers/list_pagination_test.go index 10f8adc8..a5cc5727 100644 --- a/backend/pkg/handlers/list_pagination_test.go +++ b/backend/pkg/handlers/list_pagination_test.go @@ -8,7 +8,7 @@ import ( "reflect" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/go-chi/chi/v5" "github.com/ai-openshell/console/backend/pkg/services" diff --git a/backend/pkg/handlers/logs_handler.go b/backend/pkg/handlers/logs_handler.go index b840e88d..9a9cbd39 100644 --- a/backend/pkg/handlers/logs_handler.go +++ b/backend/pkg/handlers/logs_handler.go @@ -10,8 +10,8 @@ import ( "strconv" "time" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/handlers/logs_handler_test.go b/backend/pkg/handlers/logs_handler_test.go index 0076fc90..38547aeb 100644 --- a/backend/pkg/handlers/logs_handler_test.go +++ b/backend/pkg/handlers/logs_handler_test.go @@ -12,10 +12,10 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/types" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/backend/pkg/handlers/mock_sdk_test.go b/backend/pkg/handlers/mock_sdk_test.go index 8eaca70e..2cbe957b 100644 --- a/backend/pkg/handlers/mock_sdk_test.go +++ b/backend/pkg/handlers/mock_sdk_test.go @@ -5,9 +5,9 @@ import ( "io" "sync" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/types" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "google.golang.org/grpc" ) @@ -34,8 +34,11 @@ func (m *mockSDK) Health() openshell.HealthInterface { return &m.health } func (m *mockSDK) SandboxSuspendResume() openshell.SandboxSuspendResumeInterface { panic("not implemented") } -func (m *mockSDK) SSH() openshell.SSHInterface { panic("not implemented") } -func (m *mockSDK) TCP() openshell.TCPInterface { panic("not implemented") } +func (m *mockSDK) SSH() openshell.SSHInterface { panic("not implemented") } +func (m *mockSDK) TCP() openshell.TCPInterface { panic("not implemented") } +func (m *mockSDK) SandboxLogsWatch() openshell.SandboxLogsWatchInterface { + panic("not implemented") +} func (m *mockSDK) Config() openshell.ConfigInterface { return &m.config } func (m *mockSDK) Policy() openshell.PolicyInterface { return &m.policy } func (m *mockSDK) Workspaces() openshell.WorkspaceInterface { return &m.workspaces } diff --git a/backend/pkg/handlers/policies_handler.go b/backend/pkg/handlers/policies_handler.go index a3d8a1d5..4361fbca 100644 --- a/backend/pkg/handlers/policies_handler.go +++ b/backend/pkg/handlers/policies_handler.go @@ -8,7 +8,7 @@ import ( "strconv" "sync" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/handlers/policies_handler_test.go b/backend/pkg/handlers/policies_handler_test.go index 9b33b07a..1e852367 100644 --- a/backend/pkg/handlers/policies_handler_test.go +++ b/backend/pkg/handlers/policies_handler_test.go @@ -10,9 +10,9 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - sdktypes "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + sdktypes "github.com/ai-openshell/sdk-go/openshell/v1/types" ) func policyStatusVersion(opts []openshell.GetStatusOption) uint32 { diff --git a/backend/pkg/handlers/policies_revisions_handler_test.go b/backend/pkg/handlers/policies_revisions_handler_test.go index 23463d93..912b9ea5 100644 --- a/backend/pkg/handlers/policies_revisions_handler_test.go +++ b/backend/pkg/handlers/policies_revisions_handler_test.go @@ -11,11 +11,11 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - sdktypes "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/models" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + sdktypes "github.com/ai-openshell/sdk-go/openshell/v1/types" ) // policyRoutes mounts every policy route on the paths app.go gives them. diff --git a/backend/pkg/handlers/provider_profiles_handler_test.go b/backend/pkg/handlers/provider_profiles_handler_test.go index 644d162f..7c0aa37a 100644 --- a/backend/pkg/handlers/provider_profiles_handler_test.go +++ b/backend/pkg/handlers/provider_profiles_handler_test.go @@ -12,10 +12,11 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" - sbv1 "github.com/NVIDIA/OpenShell/sdk/go/proto/sandboxv1" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/types" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" + sbv1 "github.com/ai-openshell/sdk-go/proto/sandboxv1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/encoding/protojson" @@ -671,17 +672,15 @@ func TestProfilesWrittenThroughTheSDK(t *testing.T) { t.Fatalf("the SDK was given %+v\nwant %+v", imported, wantImported) } + // From OpenShell 0.1.9 the SDK carries an endpoint whole, so an access + // preset goes through to the SDK instead of being refused. ruled := strings.Replace(plain, `"protocol":"rest"`, `"protocol":"rest","access":"NETWORK_ACCESS_PRESET_READ_ONLY"`, 1) w := serveProfiles(handler, http.MethodPost, "/workspaces/team-a/provider-profiles", `{"profiles":[`+ruled+`]}`) - if w.Code != http.StatusBadRequest { - t.Fatalf("status = %d, want 400; body: %s", w.Code, w.Body.String()) + if w.Code != http.StatusCreated { + t.Fatalf("status = %d, want 201; body: %s", w.Code, w.Body.String()) } - answer := decodeObject(t, w) - message, _ := answer["message"].(string) - if answer["code"] != "invalid_profile" || !strings.Contains(message, "endpoints[0]") { - t.Errorf("answer = %v", answer) - } - if len(imported) != 1 { - t.Errorf("the SDK was given a profile whose endpoint it would have stored without its access preset") + if len(imported) != 2 || len(imported[1].Profile.Endpoints) != 1 || + imported[1].Profile.Endpoints[0].Access != types.NetworkAccessPresetReadOnly { + t.Errorf("the SDK was not given the endpoint with its access preset: %+v", imported) } } diff --git a/backend/pkg/handlers/providers_handler.go b/backend/pkg/handlers/providers_handler.go index 3eaf1bc2..e387a83a 100644 --- a/backend/pkg/handlers/providers_handler.go +++ b/backend/pkg/handlers/providers_handler.go @@ -5,7 +5,7 @@ import ( "net/http" "time" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/handlers/providers_handler_test.go b/backend/pkg/handlers/providers_handler_test.go index 1165a8f0..7138aa81 100644 --- a/backend/pkg/handlers/providers_handler_test.go +++ b/backend/pkg/handlers/providers_handler_test.go @@ -12,9 +12,9 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/backend/pkg/handlers/sandbox_settings_handler_test.go b/backend/pkg/handlers/sandbox_settings_handler_test.go index 314498b0..1926bdfd 100644 --- a/backend/pkg/handlers/sandbox_settings_handler_test.go +++ b/backend/pkg/handlers/sandbox_settings_handler_test.go @@ -11,7 +11,7 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) // sandboxSettingsRouter serves the three sandbox-settings routes the way diff --git a/backend/pkg/handlers/sandboxes_handler_test.go b/backend/pkg/handlers/sandboxes_handler_test.go index 70c12c1d..ec410c20 100644 --- a/backend/pkg/handlers/sandboxes_handler_test.go +++ b/backend/pkg/handlers/sandboxes_handler_test.go @@ -12,9 +12,9 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/models" "github.com/ai-openshell/console/backend/pkg/services" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) func TestListSandboxes(t *testing.T) { diff --git a/backend/pkg/handlers/services_handler_test.go b/backend/pkg/handlers/services_handler_test.go index dbb638ce..2b8ba218 100644 --- a/backend/pkg/handlers/services_handler_test.go +++ b/backend/pkg/handlers/services_handler_test.go @@ -10,7 +10,7 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) func TestListServices(t *testing.T) { diff --git a/backend/pkg/handlers/settings_handler.go b/backend/pkg/handlers/settings_handler.go index 9e7bdfe2..782ec1db 100644 --- a/backend/pkg/handlers/settings_handler.go +++ b/backend/pkg/handlers/settings_handler.go @@ -4,7 +4,7 @@ import ( "encoding/json" "net/http" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/handlers/settings_handler_test.go b/backend/pkg/handlers/settings_handler_test.go index 6f3d2689..52ae3141 100644 --- a/backend/pkg/handlers/settings_handler_test.go +++ b/backend/pkg/handlers/settings_handler_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) // The gateway's settings are typed and the read keeps the type: a bool comes diff --git a/backend/pkg/handlers/templates_handler.go b/backend/pkg/handlers/templates_handler.go index c59d8da3..6bf13ff3 100644 --- a/backend/pkg/handlers/templates_handler.go +++ b/backend/pkg/handlers/templates_handler.go @@ -4,7 +4,7 @@ import ( "log/slog" "net/http" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/handlers/templates_handler_test.go b/backend/pkg/handlers/templates_handler_test.go index c0f589ff..4737a1fc 100644 --- a/backend/pkg/handlers/templates_handler_test.go +++ b/backend/pkg/handlers/templates_handler_test.go @@ -12,7 +12,7 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/services" diff --git a/backend/pkg/handlers/terminal_handler.go b/backend/pkg/handlers/terminal_handler.go index 950a77de..cbac4f67 100644 --- a/backend/pkg/handlers/terminal_handler.go +++ b/backend/pkg/handlers/terminal_handler.go @@ -14,7 +14,7 @@ import ( "github.com/gorilla/websocket" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/services" ) diff --git a/backend/pkg/handlers/terminal_handler_test.go b/backend/pkg/handlers/terminal_handler_test.go index f1b38619..c9538505 100644 --- a/backend/pkg/handlers/terminal_handler_test.go +++ b/backend/pkg/handlers/terminal_handler_test.go @@ -14,7 +14,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/gorilla/websocket" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) func TestCheckWebSocketOrigin(t *testing.T) { diff --git a/backend/pkg/handlers/workspaces_handler_test.go b/backend/pkg/handlers/workspaces_handler_test.go index 455bb496..f4b2d265 100644 --- a/backend/pkg/handlers/workspaces_handler_test.go +++ b/backend/pkg/handlers/workspaces_handler_test.go @@ -10,7 +10,7 @@ import ( "github.com/go-chi/chi/v5" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) func TestListWorkspaces(t *testing.T) { diff --git a/backend/pkg/models/deletion_test.go b/backend/pkg/models/deletion_test.go index 07724f4f..4b877fd2 100644 --- a/backend/pkg/models/deletion_test.go +++ b/backend/pkg/models/deletion_test.go @@ -3,7 +3,7 @@ package models import ( "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) // The SDK contract (openshell/v1/types/mutations.go) is explicit: only diff --git a/backend/pkg/models/gateway_converters_test.go b/backend/pkg/models/gateway_converters_test.go index 50fb5b27..7eac5ea5 100644 --- a/backend/pkg/models/gateway_converters_test.go +++ b/backend/pkg/models/gateway_converters_test.go @@ -5,7 +5,7 @@ import ( "reflect" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) // Every field of a negotiated extension reaches the frontend, and the kind is diff --git a/backend/pkg/models/policy_converters_test.go b/backend/pkg/models/policy_converters_test.go index e87f9244..4f46a8a7 100644 --- a/backend/pkg/models/policy_converters_test.go +++ b/backend/pkg/models/policy_converters_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) // effectivePolicyJSON returns the DTO for config and the JSON object the diff --git a/backend/pkg/models/policyproto.go b/backend/pkg/models/policyproto.go index cc5decbb..293dd163 100644 --- a/backend/pkg/models/policyproto.go +++ b/backend/pkg/models/policyproto.go @@ -26,9 +26,9 @@ import ( "encoding/json" "fmt" - ostypes "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" - sbv1 "github.com/NVIDIA/OpenShell/sdk/go/proto/sandboxv1" + ostypes "github.com/ai-openshell/sdk-go/openshell/v1/types" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" + sbv1 "github.com/ai-openshell/sdk-go/proto/sandboxv1" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/types/known/structpb" ) diff --git a/backend/pkg/models/policyproto_test.go b/backend/pkg/models/policyproto_test.go index 966e1d83..0fb9c7e0 100644 --- a/backend/pkg/models/policyproto_test.go +++ b/backend/pkg/models/policyproto_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - sbv1 "github.com/NVIDIA/OpenShell/sdk/go/proto/sandboxv1" + sbv1 "github.com/ai-openshell/sdk-go/proto/sandboxv1" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" diff --git a/backend/pkg/models/policywire_test.go b/backend/pkg/models/policywire_test.go index 6115bdfd..4322ca24 100644 --- a/backend/pkg/models/policywire_test.go +++ b/backend/pkg/models/policywire_test.go @@ -8,10 +8,10 @@ import ( "sync" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - dm "github.com/NVIDIA/OpenShell/sdk/go/proto/datamodelv1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" - sbv1 "github.com/NVIDIA/OpenShell/sdk/go/proto/sandboxv1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + dm "github.com/ai-openshell/sdk-go/proto/datamodelv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" + sbv1 "github.com/ai-openshell/sdk-go/proto/sandboxv1" "google.golang.org/grpc" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" diff --git a/backend/pkg/models/provider_profile.go b/backend/pkg/models/provider_profile.go index fc913118..880b1404 100644 --- a/backend/pkg/models/provider_profile.go +++ b/backend/pkg/models/provider_profile.go @@ -7,8 +7,8 @@ import ( "strconv" "strings" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" - sbv1 "github.com/NVIDIA/OpenShell/sdk/go/proto/sandboxv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" + sbv1 "github.com/ai-openshell/sdk-go/proto/sandboxv1" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/types/known/durationpb" ) diff --git a/backend/pkg/models/provider_profile_sdk.go b/backend/pkg/models/provider_profile_sdk.go index 97e0a9ae..33c6fe83 100644 --- a/backend/pkg/models/provider_profile_sdk.go +++ b/backend/pkg/models/provider_profile_sdk.go @@ -3,10 +3,10 @@ package models import ( "fmt" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" - sbv1 "github.com/NVIDIA/OpenShell/sdk/go/proto/sandboxv1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/types" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" + sbv1 "github.com/ai-openshell/sdk-go/proto/sandboxv1" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/durationpb" ) @@ -16,10 +16,12 @@ import ( // SDK (services.NewSDKProviderProfileStore). The SDK has the same conversion // and keeps it internal. // -// Everything of a profile fits the SDK type except its endpoints, of which the -// SDK carries a host, a port and a protocol. ProviderProfileFromSDK therefore -// yields endpoints that are known to be incomplete, and ProviderProfileToSDK -// refuses an endpoint it could only send in part. +// From OpenShell 0.1.9 the SDK's profile endpoint is its policy endpoint +// (types.NetworkEndpoint = types.PolicyNetworkEndpoint), so an endpoint is +// converted with the policy endpoint converters in policyproto.go. Before, the +// SDK carried only a host, a port and a protocol. ProviderProfileToSDK still +// refuses an endpoint that does not survive the conversion unchanged, so a +// field the SDK type lacks is never dropped on the way to the gateway. // // The one other field the SDK type has no place for is a credential's // token_grant_owners (OpenShell 0.1.3). The gateway derives it and ignores a @@ -30,8 +32,7 @@ import ( // ErrEndpointNotExpressible is what ProviderProfileToSDK returns for an // endpoint that holds more than the SDK's NetworkEndpoint can carry. var ErrEndpointNotExpressible = fmt.Errorf( - "the profile has an endpoint that sets more than a host, a port and a protocol, " + - "which is all this backend can send to the gateway") + "the profile has an endpoint that sets a field this backend cannot send to the gateway") var ( sdkProfileCategories = map[openshell.ProfileCategory]pb.ProviderProfileCategory{ @@ -84,7 +85,7 @@ func sdkDurationFromProto(d *durationpb.Duration) *types.ProfileDuration { } // ProviderProfileFromSDK converts a profile read through the SDK to the -// gateway's message. Its endpoints hold the three fields the SDK carries. +// gateway's message. func ProviderProfileFromSDK(profile *openshell.ProviderProfile) *pb.ProviderProfile { if profile == nil { return nil @@ -111,11 +112,7 @@ func ProviderProfileFromSDK(profile *openshell.ProviderProfile) *pb.ProviderProf }) } for _, endpoint := range profile.Endpoints { - out.Endpoints = append(out.Endpoints, &sbv1.NetworkEndpoint{ - Host: endpoint.Host, - Port: endpoint.Port, - Protocol: endpoint.Protocol, - }) + out.Endpoints = append(out.Endpoints, policyNetworkEndpointToProto(&endpoint)) } for _, binary := range profile.Binaries { out.Binaries = append(out.Binaries, &sbv1.NetworkBinary{Path: binary.Path}) @@ -226,19 +223,11 @@ func ProviderProfileToSDK(profile *pb.ProviderProfile) (openshell.ProviderProfil }) } for index, endpoint := range profile.GetEndpoints() { - narrow := &sbv1.NetworkEndpoint{ - Host: endpoint.GetHost(), - Port: endpoint.GetPort(), - Protocol: endpoint.GetProtocol(), - } - if !proto.Equal(narrow, endpoint) { + converted := policyNetworkEndpointFromProto(endpoint) + if !proto.Equal(policyNetworkEndpointToProto(&converted), endpoint) { return openshell.ProviderProfile{}, fmt.Errorf("endpoints[%d]: %w", index, ErrEndpointNotExpressible) } - out.Endpoints = append(out.Endpoints, openshell.NetworkEndpoint{ - Host: narrow.GetHost(), - Port: narrow.GetPort(), - Protocol: narrow.GetProtocol(), - }) + out.Endpoints = append(out.Endpoints, converted) } for _, binary := range profile.GetBinaries() { out.Binaries = append(out.Binaries, openshell.NetworkBinary{Path: binary.GetPath()}) diff --git a/backend/pkg/models/provider_profile_test.go b/backend/pkg/models/provider_profile_test.go index 8f0eb46e..6e0ad40f 100644 --- a/backend/pkg/models/provider_profile_test.go +++ b/backend/pkg/models/provider_profile_test.go @@ -3,17 +3,16 @@ package models import ( "bytes" "encoding/json" - "errors" "fmt" "reflect" "strings" "testing" "time" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" - sbv1 "github.com/NVIDIA/OpenShell/sdk/go/proto/sandboxv1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/types" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" + sbv1 "github.com/ai-openshell/sdk-go/proto/sandboxv1" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" @@ -606,33 +605,35 @@ func TestProviderProfileSurvivesTheSDKRoundTrip(t *testing.T) { } } -// An endpoint the SDK can send only in part is refused whole. The gateway -// stores the endpoint it is sent, so sending three fields of one that had an -// access preset and rules would store an endpoint without them. -func TestProviderProfileToSDKRefusesToNarrowAnEndpoint(t *testing.T) { +// From OpenShell 0.1.9 the SDK's profile endpoint is its policy endpoint, so +// an endpoint with an access preset, enforcement, rules, several ports or a +// path goes through the SDK whole: written and read back, it is the endpoint +// that was sent. Before, the SDK kept a host, a port and a protocol, and these +// were refused rather than narrowed. +func TestProviderProfileToSDKCarriesAnEndpointWhole(t *testing.T) { tests := []struct { endpoint *sbv1.NetworkEndpoint name string - refused bool }{ {name: "host, port and protocol", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Port: 443, Protocol: "rest"}}, - {name: "an access preset", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Access: sbv1.NetworkAccessPreset_NETWORK_ACCESS_PRESET_READ_ONLY}, refused: true}, - {name: "enforcement", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Enforcement: sbv1.NetworkEnforcementMode_NETWORK_ENFORCEMENT_MODE_ENFORCE}, refused: true}, - {name: "rules", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Rules: []*sbv1.L7Rule{{Allow: &sbv1.L7Allow{Method: "GET"}}}}, refused: true}, - {name: "several ports", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Ports: []uint32{80, 443}}, refused: true}, - {name: "a path", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Path: "/graphql"}, refused: true}, + {name: "an access preset", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Access: sbv1.NetworkAccessPreset_NETWORK_ACCESS_PRESET_READ_ONLY}}, + {name: "enforcement", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Enforcement: sbv1.NetworkEnforcementMode_NETWORK_ENFORCEMENT_MODE_ENFORCE}}, + {name: "rules", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Rules: []*sbv1.L7Rule{{Allow: &sbv1.L7Allow{Method: "GET"}}}}}, + {name: "several ports", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Ports: []uint32{80, 443}}}, + {name: "a path", endpoint: &sbv1.NetworkEndpoint{Host: "a.example", Path: "/graphql"}}, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - _, err := ProviderProfileToSDK(&pb.ProviderProfile{ + sdk, err := ProviderProfileToSDK(&pb.ProviderProfile{ Id: "p", Endpoints: []*sbv1.NetworkEndpoint{{Host: "first.example"}, tc.endpoint}, }) - if tc.refused != errors.Is(err, ErrEndpointNotExpressible) { - t.Errorf("error = %v, refused = %v, want refused = %v", err, err != nil, tc.refused) + if err != nil { + t.Fatalf("ProviderProfileToSDK: %v", err) } - if tc.refused && !strings.HasPrefix(err.Error(), "endpoints[1]: ") { - t.Errorf("error = %v, want it to name endpoints[1]", err) + back := ProviderProfileFromSDK(&sdk).GetEndpoints() + if len(back) != 2 || !proto.Equal(back[1], tc.endpoint) { + t.Errorf("endpoint after the SDK = %v, want %v", back, tc.endpoint) } }) } diff --git a/backend/pkg/models/sandbox_converters_test.go b/backend/pkg/models/sandbox_converters_test.go index 454683ff..0d30e1c2 100644 --- a/backend/pkg/models/sandbox_converters_test.go +++ b/backend/pkg/models/sandbox_converters_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/types" ) // fullSDKSandbox is a sandbox with every field the gateway can report set to a diff --git a/backend/pkg/models/sdk_converters.go b/backend/pkg/models/sdk_converters.go index 2a17cfc7..2c8eb9d4 100644 --- a/backend/pkg/models/sdk_converters.go +++ b/backend/pkg/models/sdk_converters.go @@ -10,10 +10,10 @@ import ( "strings" "time" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" - sbv1 "github.com/NVIDIA/OpenShell/sdk/go/proto/sandboxv1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/types" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" + sbv1 "github.com/ai-openshell/sdk-go/proto/sandboxv1" "google.golang.org/protobuf/encoding/protojson" ) diff --git a/backend/pkg/models/sdk_converters_test.go b/backend/pkg/models/sdk_converters_test.go index b7618259..e2d7dd1d 100644 --- a/backend/pkg/models/sdk_converters_test.go +++ b/backend/pkg/models/sdk_converters_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/types" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/types" ) func TestBuildSDKSandboxSpecBasic(t *testing.T) { diff --git a/backend/pkg/server/allworkspaces_routes_test.go b/backend/pkg/server/allworkspaces_routes_test.go index e8885449..b4c3dce9 100644 --- a/backend/pkg/server/allworkspaces_routes_test.go +++ b/backend/pkg/server/allworkspaces_routes_test.go @@ -9,8 +9,8 @@ import ( "sort" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/fake" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/fake" "github.com/ai-openshell/console/backend/pkg/auth" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/server/app.go b/backend/pkg/server/app.go index c9d31864..06800d14 100644 --- a/backend/pkg/server/app.go +++ b/backend/pkg/server/app.go @@ -10,7 +10,7 @@ import ( "github.com/go-chi/chi/v5" chimiddleware "github.com/go-chi/chi/v5/middleware" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/auth" diff --git a/backend/pkg/server/cache_control_test.go b/backend/pkg/server/cache_control_test.go index 8c0a4d85..25496c0d 100644 --- a/backend/pkg/server/cache_control_test.go +++ b/backend/pkg/server/cache_control_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "testing" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/fake" + "github.com/ai-openshell/sdk-go/openshell/v1/fake" "github.com/ai-openshell/console/backend/pkg/auth" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/server/draft_summary_routes_test.go b/backend/pkg/server/draft_summary_routes_test.go index 3768ef01..c3213964 100644 --- a/backend/pkg/server/draft_summary_routes_test.go +++ b/backend/pkg/server/draft_summary_routes_test.go @@ -9,8 +9,8 @@ import ( "sync" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/fake" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/fake" "github.com/ai-openshell/console/backend/pkg/auth" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/server/gateway_release_line_test.go b/backend/pkg/server/gateway_release_line_test.go index b559498f..31aa59fa 100644 --- a/backend/pkg/server/gateway_release_line_test.go +++ b/backend/pkg/server/gateway_release_line_test.go @@ -8,8 +8,8 @@ import ( "strings" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/fake" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/fake" "github.com/ai-openshell/console/backend/pkg/auth" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/server/policy_routes_test.go b/backend/pkg/server/policy_routes_test.go index 158d8d02..d6764787 100644 --- a/backend/pkg/server/policy_routes_test.go +++ b/backend/pkg/server/policy_routes_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/fake" + "github.com/ai-openshell/sdk-go/openshell/v1/fake" "github.com/ai-openshell/console/backend/pkg/apiutils" "github.com/ai-openshell/console/backend/pkg/auth" diff --git a/backend/pkg/server/provider_profiles_test.go b/backend/pkg/server/provider_profiles_test.go index 0dd8904d..ae83bb73 100644 --- a/backend/pkg/server/provider_profiles_test.go +++ b/backend/pkg/server/provider_profiles_test.go @@ -8,8 +8,8 @@ import ( "strings" "testing" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/fake" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + "github.com/ai-openshell/sdk-go/openshell/v1/fake" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "github.com/ai-openshell/console/backend/pkg/auth" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/server/sandbox_settings_test.go b/backend/pkg/server/sandbox_settings_test.go index 3ea4a1d5..b2273f27 100644 --- a/backend/pkg/server/sandbox_settings_test.go +++ b/backend/pkg/server/sandbox_settings_test.go @@ -8,8 +8,8 @@ import ( "strings" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/fake" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/fake" "github.com/ai-openshell/console/backend/pkg/auth" "github.com/ai-openshell/console/backend/pkg/models" diff --git a/backend/pkg/services/config.go b/backend/pkg/services/config.go index ab84f6bc..28959abd 100644 --- a/backend/pkg/services/config.go +++ b/backend/pkg/services/config.go @@ -1,7 +1,7 @@ package services import ( - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) type ConfigServiceInterface interface { diff --git a/backend/pkg/services/exec.go b/backend/pkg/services/exec.go index f6059791..723f99b7 100644 --- a/backend/pkg/services/exec.go +++ b/backend/pkg/services/exec.go @@ -1,7 +1,7 @@ package services import ( - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) type ExecServiceInterface interface { diff --git a/backend/pkg/services/gateway.go b/backend/pkg/services/gateway.go index f9f05dfb..7c1ba9e8 100644 --- a/backend/pkg/services/gateway.go +++ b/backend/pkg/services/gateway.go @@ -6,8 +6,8 @@ package services import ( "context" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" "github.com/ai-openshell/console/backend/pkg/models" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) // GatewayServiceInterface is what GatewayHandler depends on. GatewayService diff --git a/backend/pkg/services/gateway_test.go b/backend/pkg/services/gateway_test.go index d4bff816..64f957c2 100644 --- a/backend/pkg/services/gateway_test.go +++ b/backend/pkg/services/gateway_test.go @@ -4,10 +4,10 @@ import ( "context" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1/fake" - "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" - "github.com/NVIDIA/OpenShell/sdk/go/proto/optionsv1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + "github.com/ai-openshell/sdk-go/openshell/v1/fake" + "github.com/ai-openshell/sdk-go/proto/openshellv1" + "github.com/ai-openshell/sdk-go/proto/optionsv1" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" ) diff --git a/backend/pkg/services/policy.go b/backend/pkg/services/policy.go index 0073ccf6..fbcdc60e 100644 --- a/backend/pkg/services/policy.go +++ b/backend/pkg/services/policy.go @@ -1,7 +1,7 @@ package services import ( - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) type PolicyServiceInterface interface { diff --git a/backend/pkg/services/provider.go b/backend/pkg/services/provider.go index fbdb3e57..d7351229 100644 --- a/backend/pkg/services/provider.go +++ b/backend/pkg/services/provider.go @@ -3,7 +3,7 @@ package services import ( "context" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) type ProviderServiceInterface interface { diff --git a/backend/pkg/services/provider_profile.go b/backend/pkg/services/provider_profile.go index 8a10a8a4..135859a1 100644 --- a/backend/pkg/services/provider_profile.go +++ b/backend/pkg/services/provider_profile.go @@ -3,8 +3,8 @@ package services import ( "context" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "github.com/ai-openshell/console/backend/pkg/models" ) @@ -38,13 +38,13 @@ type NarrowProviderProfileStore interface { // SDKProviderProfileStore is a ProviderProfileStore over the SDK's profile // client. // -// What it reads has narrow endpoints. What it writes is checked first: a -// profile with an endpoint the SDK could only send in part is refused with -// models.ErrEndpointNotExpressible instead of being stored without its rules. -// It cannot protect what it cannot see, though: an update replaces the stored -// profile, so updating a profile whose stored endpoints say more than a host, -// a port and a protocol drops the rest. Use clients.RawExecClient wherever -// profiles are edited. +// From OpenShell 0.1.9 the SDK's profile endpoint is its policy endpoint and +// carries an endpoint whole. What it writes is still checked first: a profile +// with an endpoint that does not survive the SDK's type unchanged is refused +// with models.ErrEndpointNotExpressible instead of being stored without part of +// it. It still reports narrow endpoints (EndpointsAreNarrow), and +// clients/rawprofile.go is still what the app uses, until both are retired in +// a change of their own. type SDKProviderProfileStore struct { profiles openshell.ProfileInterface } diff --git a/backend/pkg/services/provider_profile_test.go b/backend/pkg/services/provider_profile_test.go index 26fd987a..17d956ba 100644 --- a/backend/pkg/services/provider_profile_test.go +++ b/backend/pkg/services/provider_profile_test.go @@ -6,9 +6,9 @@ import ( "reflect" "testing" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" - sbv1 "github.com/NVIDIA/OpenShell/sdk/go/proto/sandboxv1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" + sbv1 "github.com/ai-openshell/sdk-go/proto/sandboxv1" "google.golang.org/protobuf/proto" "github.com/ai-openshell/console/backend/pkg/models" @@ -177,9 +177,10 @@ func TestSDKProviderProfileStoreWritesWhatTheSDKCanCarry(t *testing.T) { } } -// An endpoint with an access preset cannot go through the SDK whole. It is -// refused before the SDK is called, not stored without the preset. -func TestSDKProviderProfileStoreRefusesToNarrowAnEndpoint(t *testing.T) { +// From OpenShell 0.1.9 the SDK carries an endpoint whole, so one with an +// access preset goes through the SDK-backed store as it is. Before, it was +// refused before the SDK was called rather than stored without the preset. +func TestSDKProviderProfileStoreCarriesAnEndpointWhole(t *testing.T) { sdk := &fakeSDKProfiles{} store := NewSDKProviderProfileStore(sdk) ctx := context.Background() @@ -188,12 +189,12 @@ func TestSDKProviderProfileStoreRefusesToNarrowAnEndpoint(t *testing.T) { _, updateErr := store.UpdateProviderProfile(ctx, "team-a", "custom", 4, ruledItem()) _, lintErr := store.LintProviderProfiles(ctx, "team-a", []*pb.ProviderProfileImportItem{ruledItem()}) for name, err := range map[string]error{"import": importErr, "update": updateErr, "lint": lintErr} { - if !errors.Is(err, models.ErrEndpointNotExpressible) { - t.Errorf("%s error = %v, want ErrEndpointNotExpressible", name, err) + if errors.Is(err, models.ErrEndpointNotExpressible) { + t.Errorf("%s error = %v, want the endpoint sent whole", name, err) } } - if len(sdk.calls) != 0 { - t.Errorf("the SDK was called (%v) with a profile it would have narrowed", sdk.calls) + if len(sdk.calls) != 3 { + t.Errorf("SDK calls = %v, want import, update and lint", sdk.calls) } } diff --git a/backend/pkg/services/sandbox.go b/backend/pkg/services/sandbox.go index a5728243..e758e705 100644 --- a/backend/pkg/services/sandbox.go +++ b/backend/pkg/services/sandbox.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" - dm "github.com/NVIDIA/OpenShell/sdk/go/proto/datamodelv1" - pb "github.com/NVIDIA/OpenShell/sdk/go/proto/openshellv1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" + dm "github.com/ai-openshell/sdk-go/proto/datamodelv1" + pb "github.com/ai-openshell/sdk-go/proto/openshellv1" "google.golang.org/grpc" ) diff --git a/backend/pkg/services/service.go b/backend/pkg/services/service.go index 034b47c0..0eecb168 100644 --- a/backend/pkg/services/service.go +++ b/backend/pkg/services/service.go @@ -1,6 +1,6 @@ package services -import openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" +import openshell "github.com/ai-openshell/sdk-go/openshell/v1" type ServiceServiceInterface interface { openshell.ServiceInterface diff --git a/backend/pkg/services/template.go b/backend/pkg/services/template.go index c2d959bd..63223546 100644 --- a/backend/pkg/services/template.go +++ b/backend/pkg/services/template.go @@ -3,7 +3,7 @@ package services import ( "context" - openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" + openshell "github.com/ai-openshell/sdk-go/openshell/v1" ) type TemplateServiceInterface interface { diff --git a/backend/pkg/services/workspace.go b/backend/pkg/services/workspace.go index 3f2d2d50..b62c6ed0 100644 --- a/backend/pkg/services/workspace.go +++ b/backend/pkg/services/workspace.go @@ -1,6 +1,6 @@ package services -import openshell "github.com/NVIDIA/OpenShell/sdk/go/openshell/v1" +import openshell "github.com/ai-openshell/sdk-go/openshell/v1" type WorkspaceServiceInterface interface { openshell.WorkspaceInterface diff --git a/deploy/ci/gateway-pins.json b/deploy/ci/gateway-pins.json index 09f916ab..15f7d1b5 100644 --- a/deploy/ci/gateway-pins.json +++ b/deploy/ci/gateway-pins.json @@ -35,10 +35,10 @@ "file, so CI requires the exact form it writes: after a hand edit, run", "`python3 deploy/ci/upstream/follow.py format-pins`." ], - "release": "0.1.6", - "sdk": "v0.0.0-20261027154453-ac7f615cd12d", - "gateway_image": "ghcr.io/nvidia/openshell/gateway:0.1.6@sha256:f0b36dba21d282c52e498c25289658cfd6cd4f343b0069fde5609e25b002cdea", - "supervisor_image": "ghcr.io/nvidia/openshell/supervisor:0.1.6@sha256:ce859a7d77ee515d3fe0b3c7dc61286516f402eb1d25c761d806d9ae5ed96c0b", + "release": "0.1.9", + "sdk": "v0.1.9", + "gateway_image": "ghcr.io/nvidia/openshell/gateway:0.1.9@sha256:1fd9e1e807990e66c9486a28d3ce9d649fd7528df48d0e830d2de2148b52dfe5", + "supervisor_image": "ghcr.io/nvidia/openshell/supervisor:0.1.9@sha256:f1ec231b5dbe5b6a40c33acb2ac847995aabb959a56134ef6d7d7aa4f43199d3", "sandbox_image": "ghcr.io/nvidia/openshell-community/sandboxes/base:latest@sha256:aeef1c63f00e2913ea002ccb3aaf925f338b5c5d70e63576f0d95c16a138044e", "config_schema": "v2" }