Skip to content

Commit 4653b4e

Browse files
authored
Update protocol servers that will require identity RPC implementations (#354)
* update all deps * revert to earlier examples * fix testing temp * update deps
1 parent a0e3e77 commit 4653b4e

File tree

8 files changed

+45
-9
lines changed

8 files changed

+45
-9
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ require (
1212
github.com/hashicorp/terraform-plugin-framework-timeouts v0.5.0
1313
github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0
1414
github.com/hashicorp/terraform-plugin-framework-validators v0.18.0
15-
github.com/hashicorp/terraform-plugin-go v0.27.0
16-
github.com/hashicorp/terraform-plugin-mux v0.19.0
15+
github.com/hashicorp/terraform-plugin-go v0.27.1-0.20250521190222-e4163ede0746
16+
github.com/hashicorp/terraform-plugin-mux v0.19.1-0.20250521191935-028fb584efcf
1717
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0
18-
github.com/hashicorp/terraform-plugin-testing v1.13.0
18+
github.com/hashicorp/terraform-plugin-testing v1.13.1-0.20250521192739-18f8d556d02d
1919
github.com/zclconf/go-cty v1.16.3
2020
)
2121

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0 h1:v3DapR8gsp3E
9999
github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0/go.mod h1:c3PnGE9pHBDfdEVG9t1S1C9ia5LW+gkFR0CygXlM8ak=
100100
github.com/hashicorp/terraform-plugin-framework-validators v0.18.0 h1:OQnlOt98ua//rCw+QhBbSqfW3QbwtVrcdWeQN5gI3Hw=
101101
github.com/hashicorp/terraform-plugin-framework-validators v0.18.0/go.mod h1:lZvZvagw5hsJwuY7mAY6KUz45/U6fiDR0CzQAwWD0CA=
102-
github.com/hashicorp/terraform-plugin-go v0.27.0 h1:ujykws/fWIdsi6oTUT5Or4ukvEan4aN9lY+LOxVP8EE=
103-
github.com/hashicorp/terraform-plugin-go v0.27.0/go.mod h1:FDa2Bb3uumkTGSkTFpWSOwWJDwA7bf3vdP3ltLDTH6o=
102+
github.com/hashicorp/terraform-plugin-go v0.27.1-0.20250521190222-e4163ede0746 h1:Bzdpky/7WRDZBfxsktI97ZhUmZVxDzHGqb3jIcqvOIk=
103+
github.com/hashicorp/terraform-plugin-go v0.27.1-0.20250521190222-e4163ede0746/go.mod h1:FDa2Bb3uumkTGSkTFpWSOwWJDwA7bf3vdP3ltLDTH6o=
104104
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
105105
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
106-
github.com/hashicorp/terraform-plugin-mux v0.19.0 h1:F2QxnHfsvdoWbF7EWeEHA+sfmBetlW5pipq+zWnVdIc=
107-
github.com/hashicorp/terraform-plugin-mux v0.19.0/go.mod h1:MO+7zYzrMz2Ohc5r8m7sM6YT+F8ET4lgYKe2GhiYW0g=
106+
github.com/hashicorp/terraform-plugin-mux v0.19.1-0.20250521191935-028fb584efcf h1:XTWFnjH5nPHe4Vjq0iDZ1s5MKUdBX+7hogk528fccmI=
107+
github.com/hashicorp/terraform-plugin-mux v0.19.1-0.20250521191935-028fb584efcf/go.mod h1:TyUwvT/kDzsGNge6A9uTG0VxAP8iDCPE9u6mpX0inmw=
108108
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 h1:NFPMacTrY/IdcIcnUB+7hsore1ZaRWU9cnB6jFoBnIM=
109109
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0/go.mod h1:QYmYnLfsosrxjCnGY1p9c7Zj6n9thnEE+7RObeYs3fA=
110-
github.com/hashicorp/terraform-plugin-testing v1.13.0 h1:vTELm6x3Z4H9VO3fbz71wbJhbs/5dr5DXfIwi3GMmPY=
111-
github.com/hashicorp/terraform-plugin-testing v1.13.0/go.mod h1:b/hl6YZLm9fjeud/3goqh/gdqhZXbRfbHMkEiY9dZwc=
110+
github.com/hashicorp/terraform-plugin-testing v1.13.1-0.20250521192739-18f8d556d02d h1:zDdHdi3vH5xYn1Znj61egI4yjUOvdmCqiGFOctZvrZY=
111+
github.com/hashicorp/terraform-plugin-testing v1.13.1-0.20250521192739-18f8d556d02d/go.mod h1:G+cgTrkSOJQI4aPNxLFuWtdyRtqPSuWe5cI7AL0n6zI=
112112
github.com/hashicorp/terraform-registry-address v0.2.5 h1:2GTftHqmUhVOeuu9CW3kwDkRe4pcBDq0uuK5VJngU1M=
113113
github.com/hashicorp/terraform-registry-address v0.2.5/go.mod h1:PpzXWINwB5kuVS5CA7m1+eO2f1jKb5ZDIxrOPfpnGkg=
114114
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=

internal/protocolprovider/resource_router.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,15 @@ func (r resourceRouter) MoveResourceState(ctx context.Context, req *tfprotov5.Mo
7373

7474
return res.MoveResourceState(ctx, req)
7575
}
76+
77+
func (r resourceRouter) UpgradeResourceIdentity(context.Context, *tfprotov5.UpgradeResourceIdentityRequest) (*tfprotov5.UpgradeResourceIdentityResponse, error) {
78+
return &tfprotov5.UpgradeResourceIdentityResponse{
79+
Diagnostics: []*tfprotov5.Diagnostic{
80+
{
81+
Severity: tfprotov5.DiagnosticSeverityError,
82+
Summary: "Unsupported Upgrade Resource Identity Operation",
83+
Detail: "Resource identity is not supported by this provider.",
84+
},
85+
},
86+
}, nil
87+
}

internal/protocolprovider/server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ func (s *server) GetProviderSchema(ctx context.Context, req *tfprotov5.GetProvid
6767
}, nil
6868
}
6969

70+
func (s *server) GetResourceIdentitySchemas(context.Context, *tfprotov5.GetResourceIdentitySchemasRequest) (*tfprotov5.GetResourceIdentitySchemasResponse, error) {
71+
return &tfprotov5.GetResourceIdentitySchemasResponse{}, nil
72+
}
73+
7074
func (s *server) PrepareProviderConfig(ctx context.Context, req *tfprotov5.PrepareProviderConfigRequest) (*tfprotov5.PrepareProviderConfigResponse, error) {
7175
return &tfprotov5.PrepareProviderConfigResponse{
7276
PreparedConfig: req.Config,

internal/protocolprovider/writeonly_datacheck.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212
)
1313

1414
type resourceWriteOnlyDataCheck struct {
15+
resourceRouter
16+
1517
enableLegacyTypeSystem bool
1618
applyDataError bool
1719
planDataError bool

internal/protocolv6provider/resource_router.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,15 @@ func (r resourceRouter) MoveResourceState(ctx context.Context, req *tfprotov6.Mo
7373

7474
return res.MoveResourceState(ctx, req)
7575
}
76+
77+
func (r resourceRouter) UpgradeResourceIdentity(context.Context, *tfprotov6.UpgradeResourceIdentityRequest) (*tfprotov6.UpgradeResourceIdentityResponse, error) {
78+
return &tfprotov6.UpgradeResourceIdentityResponse{
79+
Diagnostics: []*tfprotov6.Diagnostic{
80+
{
81+
Severity: tfprotov6.DiagnosticSeverityError,
82+
Summary: "Unsupported Upgrade Resource Identity Operation",
83+
Detail: "Resource identity is not supported by this provider.",
84+
},
85+
},
86+
}, nil
87+
}

internal/protocolv6provider/server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ func (s *server) GetProviderSchema(ctx context.Context, req *tfprotov6.GetProvid
6767
}, nil
6868
}
6969

70+
func (s *server) GetResourceIdentitySchemas(context.Context, *tfprotov6.GetResourceIdentitySchemasRequest) (*tfprotov6.GetResourceIdentitySchemasResponse, error) {
71+
return &tfprotov6.GetResourceIdentitySchemasResponse{}, nil
72+
}
73+
7074
func (s *server) ValidateProviderConfig(ctx context.Context, req *tfprotov6.ValidateProviderConfigRequest) (*tfprotov6.ValidateProviderConfigResponse, error) {
7175
return &tfprotov6.ValidateProviderConfigResponse{
7276
PreparedConfig: req.Config,

internal/protocolv6provider/writeonly_datacheck.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212
)
1313

1414
type resourceWriteOnlyDataCheck struct {
15+
resourceRouter
16+
1517
enableLegacyTypeSystem bool
1618
applyDataError bool
1719
planDataError bool

0 commit comments

Comments
 (0)