Skip to content

Commit

Permalink
Include path version in string to allow more control over endpoint us…
Browse files Browse the repository at this point in the history
…ed per resource
  • Loading branch information
scastrianni committed Jan 8, 2024
1 parent 136fa4d commit a883bdf
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion konnect/client/authentication_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package client

const (
AuthenticationSettingsId = "authentication-settings"
AuthenticationSettingsPath = AuthenticationSettingsId
AuthenticationSettingsPath = "v3/" + AuthenticationSettingsId
)

type AuthenticationSettings struct {
Expand Down
2 changes: 1 addition & 1 deletion konnect/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ func (c *Client) RequestPath(isRegion bool, path string) string {
} else {
host = GlobalRegion
}
return fmt.Sprintf("https://%s.%s/v2/%s", host, KonnectDomain, path)
return fmt.Sprintf("https://%s.%s/%s", host, KonnectDomain, path)
}
2 changes: 1 addition & 1 deletion konnect/client/control_plane.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package client

const (
ControlPlanePath = "control-planes"
ControlPlanePath = "v2/control-planes"
ControlPlanePathGet = ControlPlanePath + "/%s"
)

Expand Down
2 changes: 1 addition & 1 deletion konnect/client/identity_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package client

const (
IdentityProviderId = "identity-provider"
IdentityProviderPath = IdentityProviderId
IdentityProviderPath = "v3/" + IdentityProviderId
EmailClaim = "email"
NameClaim = "name"
GroupsClaim = "groups"
Expand Down
2 changes: 1 addition & 1 deletion konnect/client/role.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package client

const (
RolePath = "roles"
RolePath = "v3/roles"
ControlPlanesDisplayName = "Control Planes"
ServicesDisplayName = "Services"
)
Expand Down
2 changes: 1 addition & 1 deletion konnect/client/team.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package client

const (
TeamPath = "teams"
TeamPath = "v3/teams"
TeamPathGet = TeamPath + "/%s"
)

Expand Down
2 changes: 1 addition & 1 deletion konnect/client/team_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package client
import "strings"

const (
TeamRolePath = "teams/%s/assigned-roles"
TeamRolePath = "v3/teams/%s/assigned-roles"
TeamRolePathCreate = TeamRolePath
TeamRolePathDelete = TeamRolePath + "/%s"
)
Expand Down
2 changes: 1 addition & 1 deletion konnect/client/team_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package client
import "strings"

const (
TeamUserPath = "teams/%s/users"
TeamUserPath = "v3/teams/%s/users"
TeamUserPathCreate = TeamUserPath
TeamUserPathDelete = TeamUserPath + "/%s"
)
Expand Down
2 changes: 1 addition & 1 deletion konnect/client/user.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package client

const (
UserPath = "users"
UserPath = "v3/users"
UserPathGet = UserPath + "/%s"
)

Expand Down
2 changes: 1 addition & 1 deletion konnect/client/user_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package client
import "strings"

const (
UserRolePath = "users/%s/assigned-roles"
UserRolePath = "v3/users/%s/assigned-roles"
UserRolePathCreate = UserRolePath
UserRolePathDelete = UserRolePath + "/%s"
)
Expand Down
6 changes: 3 additions & 3 deletions test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ provider "konnect" {
# role_display_name = data.konnect_role.R.display_name
#}

#data "konnect_team" "T" {
# name = "runtime-admin"
#}
data "konnect_team" "T" {
name = "api-product-developer"
}

#resource "konnect_user" "U" {
# email = "jblow@example.com"
Expand Down

0 comments on commit a883bdf

Please sign in to comment.