K8s/IAM: Move identity.grafana.app to iam.grafana.app (#92929)

pull/92963/head
Ryan McKinley 10 months ago committed by GitHub
parent aae788ae46
commit 9338e40dc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      pkg/apis/iam/v0alpha1/doc.go
  2. 2
      pkg/apis/iam/v0alpha1/register.go
  3. 0
      pkg/apis/iam/v0alpha1/types_identity.go
  4. 0
      pkg/apis/iam/v0alpha1/types_servier_account.go
  5. 0
      pkg/apis/iam/v0alpha1/types_sso.go
  6. 0
      pkg/apis/iam/v0alpha1/types_team.go
  7. 0
      pkg/apis/iam/v0alpha1/types_user.go
  8. 0
      pkg/apis/iam/v0alpha1/zz_generated.deepcopy.go
  9. 0
      pkg/apis/iam/v0alpha1/zz_generated.defaults.go
  10. 154
      pkg/apis/iam/v0alpha1/zz_generated.openapi.go
  11. 6
      pkg/apis/iam/v0alpha1/zz_generated.openapi_violation_exceptions.list
  12. 4
      pkg/registry/apis/apis.go
  13. 2
      pkg/registry/apis/iam/common/common.go
  14. 0
      pkg/registry/apis/iam/common/pagination.go
  15. 0
      pkg/registry/apis/iam/legacy/display.go
  16. 0
      pkg/registry/apis/iam/legacy/display_query.sql
  17. 0
      pkg/registry/apis/iam/legacy/sql.go
  18. 2
      pkg/registry/apis/iam/legacy/sql_test.go
  19. 2
      pkg/registry/apis/iam/legacy/team.go
  20. 0
      pkg/registry/apis/iam/legacy/team_bindings_query.sql
  21. 0
      pkg/registry/apis/iam/legacy/team_members_query.sql
  22. 0
      pkg/registry/apis/iam/legacy/teams_query.sql
  23. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--display_query-display_ids.sql
  24. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--display_query-display_ids_uids.sql
  25. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--display_query-display_uids.sql
  26. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--team_bindings_query-team_1_bindings.sql
  27. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--team_bindings_query-team_bindings_page_1.sql
  28. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--team_bindings_query-team_bindings_page_2.sql
  29. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--team_members_query-team_1_members_page_1.sql
  30. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--team_members_query-team_1_members_page_2.sql
  31. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--teams_query-teams_page_1.sql
  32. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--teams_query-teams_page_2.sql
  33. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--teams_query-teams_uid.sql
  34. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--user_teams_query-team_1_members_page_1.sql
  35. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--user_teams_query-team_1_members_page_2.sql
  36. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--users_query-users_page_1.sql
  37. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--users_query-users_page_2.sql
  38. 0
      pkg/registry/apis/iam/legacy/testdata/mysql--users_query-users_uid.sql
  39. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--display_query-display_ids.sql
  40. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--display_query-display_ids_uids.sql
  41. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--display_query-display_uids.sql
  42. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--team_bindings_query-team_1_bindings.sql
  43. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--team_bindings_query-team_bindings_page_1.sql
  44. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--team_bindings_query-team_bindings_page_2.sql
  45. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--team_members_query-team_1_members_page_1.sql
  46. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--team_members_query-team_1_members_page_2.sql
  47. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--teams_query-teams_page_1.sql
  48. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--teams_query-teams_page_2.sql
  49. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--teams_query-teams_uid.sql
  50. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--user_teams_query-team_1_members_page_1.sql
  51. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--user_teams_query-team_1_members_page_2.sql
  52. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--users_query-users_page_1.sql
  53. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--users_query-users_page_2.sql
  54. 0
      pkg/registry/apis/iam/legacy/testdata/postgres--users_query-users_uid.sql
  55. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--display_query-display_ids.sql
  56. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--display_query-display_ids_uids.sql
  57. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--display_query-display_uids.sql
  58. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--team_bindings_query-team_1_bindings.sql
  59. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--team_bindings_query-team_bindings_page_1.sql
  60. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--team_bindings_query-team_bindings_page_2.sql
  61. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--team_members_query-team_1_members_page_1.sql
  62. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--team_members_query-team_1_members_page_2.sql
  63. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--teams_query-teams_page_1.sql
  64. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--teams_query-teams_page_2.sql
  65. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--teams_query-teams_uid.sql
  66. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--user_teams_query-team_1_members_page_1.sql
  67. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--user_teams_query-team_1_members_page_2.sql
  68. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--users_query-users_page_1.sql
  69. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--users_query-users_page_2.sql
  70. 0
      pkg/registry/apis/iam/legacy/testdata/sqlite--users_query-users_uid.sql
  71. 2
      pkg/registry/apis/iam/legacy/user.go
  72. 0
      pkg/registry/apis/iam/legacy/user_teams_query.sql
  73. 0
      pkg/registry/apis/iam/legacy/users_query.sql
  74. 49
      pkg/registry/apis/iam/register.go
  75. 6
      pkg/registry/apis/iam/serviceaccount/store.go
  76. 2
      pkg/registry/apis/iam/sso/store.go
  77. 6
      pkg/registry/apis/iam/team/rest_members.go
  78. 6
      pkg/registry/apis/iam/team/store.go
  79. 6
      pkg/registry/apis/iam/team/store_binding.go
  80. 4
      pkg/registry/apis/iam/user/rest_display.go
  81. 6
      pkg/registry/apis/iam/user/rest_user_team.go
  82. 6
      pkg/registry/apis/iam/user/store.go
  83. 4
      pkg/registry/apis/wireset.go
  84. 2
      pkg/services/apiserver/builder/helper.go
  85. 10
      pkg/tests/apis/iam/iam_test.go

@ -1,6 +1,6 @@
// +k8s:deepcopy-gen=package
// +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta
// +groupName=identity.grafana.app
// +groupName=iam.grafana.app
package v0alpha1 // import "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
package v0alpha1 // import "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"

@ -11,7 +11,7 @@ import (
)
const (
GROUP = "identity.grafana.app"
GROUP = "iam.grafana.app"
VERSION = "v0alpha1"
APIVERSION = GROUP + "/" + VERSION
)

@ -14,33 +14,33 @@ import (
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
return map[string]common.OpenAPIDefinition{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.IdentityDisplay": schema_pkg_apis_identity_v0alpha1_IdentityDisplay(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.IdentityDisplayResults": schema_pkg_apis_identity_v0alpha1_IdentityDisplayResults(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.SSOSetting": schema_pkg_apis_identity_v0alpha1_SSOSetting(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.SSOSettingList": schema_pkg_apis_identity_v0alpha1_SSOSettingList(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.SSOSettingSpec": schema_pkg_apis_identity_v0alpha1_SSOSettingSpec(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.ServiceAccount": schema_pkg_apis_identity_v0alpha1_ServiceAccount(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.ServiceAccountList": schema_pkg_apis_identity_v0alpha1_ServiceAccountList(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.ServiceAccountSpec": schema_pkg_apis_identity_v0alpha1_ServiceAccountSpec(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.Team": schema_pkg_apis_identity_v0alpha1_Team(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamBinding": schema_pkg_apis_identity_v0alpha1_TeamBinding(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamBindingList": schema_pkg_apis_identity_v0alpha1_TeamBindingList(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamBindingSpec": schema_pkg_apis_identity_v0alpha1_TeamBindingSpec(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamList": schema_pkg_apis_identity_v0alpha1_TeamList(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamMember": schema_pkg_apis_identity_v0alpha1_TeamMember(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamMemberList": schema_pkg_apis_identity_v0alpha1_TeamMemberList(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamRef": schema_pkg_apis_identity_v0alpha1_TeamRef(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamSpec": schema_pkg_apis_identity_v0alpha1_TeamSpec(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamSubject": schema_pkg_apis_identity_v0alpha1_TeamSubject(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.User": schema_pkg_apis_identity_v0alpha1_User(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.UserList": schema_pkg_apis_identity_v0alpha1_UserList(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.UserSpec": schema_pkg_apis_identity_v0alpha1_UserSpec(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.UserTeam": schema_pkg_apis_identity_v0alpha1_UserTeam(ref),
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.UserTeamList": schema_pkg_apis_identity_v0alpha1_UserTeamList(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.IdentityDisplay": schema_pkg_apis_iam_v0alpha1_IdentityDisplay(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.IdentityDisplayResults": schema_pkg_apis_iam_v0alpha1_IdentityDisplayResults(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.SSOSetting": schema_pkg_apis_iam_v0alpha1_SSOSetting(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.SSOSettingList": schema_pkg_apis_iam_v0alpha1_SSOSettingList(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.SSOSettingSpec": schema_pkg_apis_iam_v0alpha1_SSOSettingSpec(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.ServiceAccount": schema_pkg_apis_iam_v0alpha1_ServiceAccount(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.ServiceAccountList": schema_pkg_apis_iam_v0alpha1_ServiceAccountList(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.ServiceAccountSpec": schema_pkg_apis_iam_v0alpha1_ServiceAccountSpec(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.Team": schema_pkg_apis_iam_v0alpha1_Team(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamBinding": schema_pkg_apis_iam_v0alpha1_TeamBinding(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamBindingList": schema_pkg_apis_iam_v0alpha1_TeamBindingList(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamBindingSpec": schema_pkg_apis_iam_v0alpha1_TeamBindingSpec(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamList": schema_pkg_apis_iam_v0alpha1_TeamList(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamMember": schema_pkg_apis_iam_v0alpha1_TeamMember(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamMemberList": schema_pkg_apis_iam_v0alpha1_TeamMemberList(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamRef": schema_pkg_apis_iam_v0alpha1_TeamRef(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamSpec": schema_pkg_apis_iam_v0alpha1_TeamSpec(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamSubject": schema_pkg_apis_iam_v0alpha1_TeamSubject(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.User": schema_pkg_apis_iam_v0alpha1_User(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.UserList": schema_pkg_apis_iam_v0alpha1_UserList(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.UserSpec": schema_pkg_apis_iam_v0alpha1_UserSpec(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.UserTeam": schema_pkg_apis_iam_v0alpha1_UserTeam(ref),
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.UserTeamList": schema_pkg_apis_iam_v0alpha1_UserTeamList(ref),
}
}
func schema_pkg_apis_identity_v0alpha1_IdentityDisplay(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_IdentityDisplay(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -91,7 +91,7 @@ func schema_pkg_apis_identity_v0alpha1_IdentityDisplay(ref common.ReferenceCallb
}
}
func schema_pkg_apis_identity_v0alpha1_IdentityDisplayResults(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_IdentityDisplayResults(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -144,7 +144,7 @@ func schema_pkg_apis_identity_v0alpha1_IdentityDisplayResults(ref common.Referen
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.IdentityDisplay"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.IdentityDisplay"),
},
},
},
@ -175,11 +175,11 @@ func schema_pkg_apis_identity_v0alpha1_IdentityDisplayResults(ref common.Referen
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.IdentityDisplay"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.IdentityDisplay"},
}
}
func schema_pkg_apis_identity_v0alpha1_SSOSetting(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_SSOSetting(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -209,18 +209,18 @@ func schema_pkg_apis_identity_v0alpha1_SSOSetting(ref common.ReferenceCallback)
"spec": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.SSOSettingSpec"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.SSOSettingSpec"),
},
},
},
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.SSOSettingSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.SSOSettingSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_SSOSettingList(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_SSOSettingList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -253,7 +253,7 @@ func schema_pkg_apis_identity_v0alpha1_SSOSettingList(ref common.ReferenceCallba
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.SSOSetting"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.SSOSetting"),
},
},
},
@ -263,11 +263,11 @@ func schema_pkg_apis_identity_v0alpha1_SSOSettingList(ref common.ReferenceCallba
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.SSOSetting", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.SSOSetting", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_SSOSettingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_SSOSettingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -297,7 +297,7 @@ func schema_pkg_apis_identity_v0alpha1_SSOSettingSpec(ref common.ReferenceCallba
}
}
func schema_pkg_apis_identity_v0alpha1_ServiceAccount(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_ServiceAccount(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -326,18 +326,18 @@ func schema_pkg_apis_identity_v0alpha1_ServiceAccount(ref common.ReferenceCallba
"spec": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.ServiceAccountSpec"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.ServiceAccountSpec"),
},
},
},
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.ServiceAccountSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.ServiceAccountSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_ServiceAccountList(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_ServiceAccountList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -370,7 +370,7 @@ func schema_pkg_apis_identity_v0alpha1_ServiceAccountList(ref common.ReferenceCa
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.ServiceAccount"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.ServiceAccount"),
},
},
},
@ -380,11 +380,11 @@ func schema_pkg_apis_identity_v0alpha1_ServiceAccountList(ref common.ReferenceCa
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.ServiceAccount", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.ServiceAccount", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_ServiceAccountSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_ServiceAccountSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -420,7 +420,7 @@ func schema_pkg_apis_identity_v0alpha1_ServiceAccountSpec(ref common.ReferenceCa
}
}
func schema_pkg_apis_identity_v0alpha1_Team(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_Team(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -449,18 +449,18 @@ func schema_pkg_apis_identity_v0alpha1_Team(ref common.ReferenceCallback) common
"spec": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamSpec"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamSpec"),
},
},
},
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_TeamBinding(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_TeamBinding(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -489,18 +489,18 @@ func schema_pkg_apis_identity_v0alpha1_TeamBinding(ref common.ReferenceCallback)
"spec": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamBindingSpec"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamBindingSpec"),
},
},
},
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamBindingSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamBindingSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_TeamBindingList(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_TeamBindingList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -533,7 +533,7 @@ func schema_pkg_apis_identity_v0alpha1_TeamBindingList(ref common.ReferenceCallb
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamBinding"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamBinding"),
},
},
},
@ -543,11 +543,11 @@ func schema_pkg_apis_identity_v0alpha1_TeamBindingList(ref common.ReferenceCallb
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamBinding", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamBinding", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_TeamBindingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_TeamBindingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -560,7 +560,7 @@ func schema_pkg_apis_identity_v0alpha1_TeamBindingSpec(ref common.ReferenceCallb
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamSubject"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamSubject"),
},
},
},
@ -569,18 +569,18 @@ func schema_pkg_apis_identity_v0alpha1_TeamBindingSpec(ref common.ReferenceCallb
"teamRef": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamRef"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamRef"),
},
},
},
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamRef", "github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamSubject"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamRef", "github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamSubject"},
}
}
func schema_pkg_apis_identity_v0alpha1_TeamList(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_TeamList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -613,7 +613,7 @@ func schema_pkg_apis_identity_v0alpha1_TeamList(ref common.ReferenceCallback) co
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.Team"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.Team"),
},
},
},
@ -623,11 +623,11 @@ func schema_pkg_apis_identity_v0alpha1_TeamList(ref common.ReferenceCallback) co
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.Team", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.Team", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_TeamMember(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_TeamMember(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -693,7 +693,7 @@ func schema_pkg_apis_identity_v0alpha1_TeamMember(ref common.ReferenceCallback)
}
}
func schema_pkg_apis_identity_v0alpha1_TeamMemberList(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_TeamMemberList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -726,7 +726,7 @@ func schema_pkg_apis_identity_v0alpha1_TeamMemberList(ref common.ReferenceCallba
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamMember"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamMember"),
},
},
},
@ -736,11 +736,11 @@ func schema_pkg_apis_identity_v0alpha1_TeamMemberList(ref common.ReferenceCallba
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamMember", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamMember", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_TeamRef(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_TeamRef(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -759,7 +759,7 @@ func schema_pkg_apis_identity_v0alpha1_TeamRef(ref common.ReferenceCallback) com
}
}
func schema_pkg_apis_identity_v0alpha1_TeamSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_TeamSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -783,7 +783,7 @@ func schema_pkg_apis_identity_v0alpha1_TeamSpec(ref common.ReferenceCallback) co
}
}
func schema_pkg_apis_identity_v0alpha1_TeamSubject(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_TeamSubject(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -810,7 +810,7 @@ func schema_pkg_apis_identity_v0alpha1_TeamSubject(ref common.ReferenceCallback)
}
}
func schema_pkg_apis_identity_v0alpha1_User(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_User(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -839,18 +839,18 @@ func schema_pkg_apis_identity_v0alpha1_User(ref common.ReferenceCallback) common
"spec": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.UserSpec"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.UserSpec"),
},
},
},
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.UserSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.UserSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_UserList(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_UserList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -883,7 +883,7 @@ func schema_pkg_apis_identity_v0alpha1_UserList(ref common.ReferenceCallback) co
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.User"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.User"),
},
},
},
@ -893,11 +893,11 @@ func schema_pkg_apis_identity_v0alpha1_UserList(ref common.ReferenceCallback) co
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.User", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.User", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
}
}
func schema_pkg_apis_identity_v0alpha1_UserSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_UserSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -939,7 +939,7 @@ func schema_pkg_apis_identity_v0alpha1_UserSpec(ref common.ReferenceCallback) co
}
}
func schema_pkg_apis_identity_v0alpha1_UserTeam(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_UserTeam(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -954,7 +954,7 @@ func schema_pkg_apis_identity_v0alpha1_UserTeam(ref common.ReferenceCallback) co
"teamRef": {
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamRef"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamRef"),
},
},
"permission": {
@ -969,11 +969,11 @@ func schema_pkg_apis_identity_v0alpha1_UserTeam(ref common.ReferenceCallback) co
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.TeamRef"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.TeamRef"},
}
}
func schema_pkg_apis_identity_v0alpha1_UserTeamList(ref common.ReferenceCallback) common.OpenAPIDefinition {
func schema_pkg_apis_iam_v0alpha1_UserTeamList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -1006,7 +1006,7 @@ func schema_pkg_apis_identity_v0alpha1_UserTeamList(ref common.ReferenceCallback
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
Ref: ref("github.com/grafana/grafana/pkg/apis/identity/v0alpha1.UserTeam"),
Ref: ref("github.com/grafana/grafana/pkg/apis/iam/v0alpha1.UserTeam"),
},
},
},
@ -1016,6 +1016,6 @@ func schema_pkg_apis_identity_v0alpha1_UserTeamList(ref common.ReferenceCallback
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/identity/v0alpha1.UserTeam", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
"github.com/grafana/grafana/pkg/apis/iam/v0alpha1.UserTeam", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
}
}

@ -1,3 +1,3 @@
API rule violation: list_type_missing,github.com/grafana/grafana/pkg/apis/identity/v0alpha1,TeamBindingSpec,Subjects
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/identity/v0alpha1,IdentityDisplay,IdentityType
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/identity/v0alpha1,IdentityDisplay,InternalID
API rule violation: list_type_missing,github.com/grafana/grafana/pkg/apis/iam/v0alpha1,TeamBindingSpec,Subjects
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/iam/v0alpha1,IdentityDisplay,IdentityType
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/iam/v0alpha1,IdentityDisplay,InternalID

@ -10,7 +10,7 @@ import (
"github.com/grafana/grafana/pkg/registry/apis/datasource"
"github.com/grafana/grafana/pkg/registry/apis/featuretoggle"
"github.com/grafana/grafana/pkg/registry/apis/folders"
"github.com/grafana/grafana/pkg/registry/apis/identity"
"github.com/grafana/grafana/pkg/registry/apis/iam"
"github.com/grafana/grafana/pkg/registry/apis/peakq"
"github.com/grafana/grafana/pkg/registry/apis/playlist"
"github.com/grafana/grafana/pkg/registry/apis/query"
@ -33,7 +33,7 @@ func ProvideRegistryServiceSink(
_ *datasource.DataSourceAPIBuilder,
_ *folders.FolderAPIBuilder,
_ *peakq.PeakQAPIBuilder,
_ *identity.IdentityAPIBuilder,
_ *iam.IdentityAccessManagementAPIBuilder,
_ *scope.ScopeAPIBuilder,
_ *query.QueryAPIBuilder,
_ *notifications.NotificationsAPIBuilder,

@ -3,7 +3,7 @@ package common
import (
"strconv"
identityv0 "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
identityv0 "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
"github.com/grafana/grafana/pkg/services/team"
)

@ -4,7 +4,7 @@ import (
"testing"
"text/template"
"github.com/grafana/grafana/pkg/registry/apis/identity/common"
"github.com/grafana/grafana/pkg/registry/apis/iam/common"
"github.com/grafana/grafana/pkg/storage/legacysql"
"github.com/grafana/grafana/pkg/storage/unified/sql/sqltemplate"
"github.com/grafana/grafana/pkg/storage/unified/sql/sqltemplate/mocks"

@ -8,7 +8,7 @@ import (
"github.com/grafana/authlib/claims"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/registry/apis/identity/common"
"github.com/grafana/grafana/pkg/registry/apis/iam/common"
"github.com/grafana/grafana/pkg/services/team"
"github.com/grafana/grafana/pkg/storage/legacysql"
"github.com/grafana/grafana/pkg/storage/unified/sql/sqltemplate"

@ -6,7 +6,7 @@ import (
"text/template"
"github.com/grafana/authlib/claims"
"github.com/grafana/grafana/pkg/registry/apis/identity/common"
"github.com/grafana/grafana/pkg/registry/apis/iam/common"
"github.com/grafana/grafana/pkg/services/team"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/storage/legacysql"

@ -1,8 +1,21 @@
package identity
package iam
import (
"context"
"github.com/grafana/grafana/pkg/apimachinery/identity"
identityv0 "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/registry/apis/iam/legacy"
"github.com/grafana/grafana/pkg/registry/apis/iam/serviceaccount"
"github.com/grafana/grafana/pkg/registry/apis/iam/sso"
"github.com/grafana/grafana/pkg/registry/apis/iam/team"
"github.com/grafana/grafana/pkg/registry/apis/iam/user"
"github.com/grafana/grafana/pkg/services/apiserver/builder"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/ssosettings"
"github.com/grafana/grafana/pkg/storage/legacysql"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
@ -12,26 +25,12 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
genericapiserver "k8s.io/apiserver/pkg/server"
common "k8s.io/kube-openapi/pkg/common"
"github.com/grafana/grafana/pkg/apimachinery/identity"
identityv0 "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/registry/apis/identity/legacy"
"github.com/grafana/grafana/pkg/registry/apis/identity/serviceaccount"
"github.com/grafana/grafana/pkg/registry/apis/identity/sso"
"github.com/grafana/grafana/pkg/registry/apis/identity/team"
"github.com/grafana/grafana/pkg/registry/apis/identity/user"
"github.com/grafana/grafana/pkg/services/apiserver/builder"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/ssosettings"
"github.com/grafana/grafana/pkg/storage/legacysql"
)
var _ builder.APIGroupBuilder = (*IdentityAPIBuilder)(nil)
var _ builder.APIGroupBuilder = (*IdentityAccessManagementAPIBuilder)(nil)
// This is used just so wire has something unique to return
type IdentityAPIBuilder struct {
type IdentityAccessManagementAPIBuilder struct {
Store legacy.LegacyIdentityStore
SSOService ssosettings.Service
}
@ -41,12 +40,12 @@ func RegisterAPIService(
apiregistration builder.APIRegistrar,
ssoService ssosettings.Service,
sql db.DB,
) (*IdentityAPIBuilder, error) {
) (*IdentityAccessManagementAPIBuilder, error) {
if !features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs) {
return nil, nil // skip registration unless opting into experimental apis
}
builder := &IdentityAPIBuilder{
builder := &IdentityAccessManagementAPIBuilder{
Store: legacy.NewLegacySQLStores(legacysql.NewDatabaseProvider(sql)),
SSOService: ssoService,
}
@ -55,11 +54,11 @@ func RegisterAPIService(
return builder, nil
}
func (b *IdentityAPIBuilder) GetGroupVersion() schema.GroupVersion {
func (b *IdentityAccessManagementAPIBuilder) GetGroupVersion() schema.GroupVersion {
return identityv0.SchemeGroupVersion
}
func (b *IdentityAPIBuilder) InstallSchema(scheme *runtime.Scheme) error {
func (b *IdentityAccessManagementAPIBuilder) InstallSchema(scheme *runtime.Scheme) error {
identityv0.AddKnownTypes(scheme, identityv0.VERSION)
// Link this version to the internal representation.
@ -71,7 +70,7 @@ func (b *IdentityAPIBuilder) InstallSchema(scheme *runtime.Scheme) error {
return scheme.SetVersionPriority(identityv0.SchemeGroupVersion)
}
func (b *IdentityAPIBuilder) GetAPIGroupInfo(
func (b *IdentityAccessManagementAPIBuilder) GetAPIGroupInfo(
scheme *runtime.Scheme,
codecs serializer.CodecFactory, // pointer?
optsGetter generic.RESTOptionsGetter,
@ -106,16 +105,16 @@ func (b *IdentityAPIBuilder) GetAPIGroupInfo(
return &apiGroupInfo, nil
}
func (b *IdentityAPIBuilder) GetOpenAPIDefinitions() common.GetOpenAPIDefinitions {
func (b *IdentityAccessManagementAPIBuilder) GetOpenAPIDefinitions() common.GetOpenAPIDefinitions {
return identityv0.GetOpenAPIDefinitions
}
func (b *IdentityAPIBuilder) GetAPIRoutes() *builder.APIRoutes {
func (b *IdentityAccessManagementAPIBuilder) GetAPIRoutes() *builder.APIRoutes {
// no custom API routes
return nil
}
func (b *IdentityAPIBuilder) GetAuthorizer() authorizer.Authorizer {
func (b *IdentityAccessManagementAPIBuilder) GetAuthorizer() authorizer.Authorizer {
// TODO: handle authorization based in entity.
return authorizer.AuthorizerFunc(
func(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) {

@ -11,9 +11,9 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
"github.com/grafana/grafana/pkg/apimachinery/utils"
identityv0 "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/identity/common"
"github.com/grafana/grafana/pkg/registry/apis/identity/legacy"
identityv0 "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/iam/common"
"github.com/grafana/grafana/pkg/registry/apis/iam/legacy"
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
"github.com/grafana/grafana/pkg/services/user"
)

@ -14,7 +14,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apiserver/pkg/registry/rest"
identityv0 "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
identityv0 "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
"github.com/grafana/grafana/pkg/services/ssosettings"
ssomodels "github.com/grafana/grafana/pkg/services/ssosettings/models"

@ -9,9 +9,9 @@ import (
"github.com/grafana/authlib/claims"
"github.com/grafana/grafana/pkg/api/dtos"
identityv0 "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/identity/common"
"github.com/grafana/grafana/pkg/registry/apis/identity/legacy"
identityv0 "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/iam/common"
"github.com/grafana/grafana/pkg/registry/apis/iam/legacy"
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
"github.com/grafana/grafana/pkg/setting"
)

@ -11,9 +11,9 @@ import (
"github.com/grafana/authlib/claims"
"github.com/grafana/grafana/pkg/apimachinery/utils"
identityv0 "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/identity/common"
"github.com/grafana/grafana/pkg/registry/apis/identity/legacy"
identityv0 "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/iam/common"
"github.com/grafana/grafana/pkg/registry/apis/iam/legacy"
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
)

@ -11,9 +11,9 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
"github.com/grafana/authlib/claims"
identityv0 "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/identity/common"
"github.com/grafana/grafana/pkg/registry/apis/identity/legacy"
identityv0 "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/iam/common"
"github.com/grafana/grafana/pkg/registry/apis/iam/legacy"
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
"github.com/grafana/grafana/pkg/services/team"
)

@ -8,8 +8,8 @@ import (
"github.com/grafana/authlib/claims"
"github.com/grafana/grafana/pkg/api/dtos"
identity "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/identity/legacy"
identity "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/iam/legacy"
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
"github.com/grafana/grafana/pkg/setting"
errorsK8s "k8s.io/apimachinery/pkg/api/errors"

@ -7,9 +7,9 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apiserver/pkg/registry/rest"
identityv0 "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/identity/common"
"github.com/grafana/grafana/pkg/registry/apis/identity/legacy"
identityv0 "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/iam/common"
"github.com/grafana/grafana/pkg/registry/apis/iam/legacy"
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
)

@ -11,9 +11,9 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
"github.com/grafana/grafana/pkg/apimachinery/utils"
identityv0 "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/identity/common"
"github.com/grafana/grafana/pkg/registry/apis/identity/legacy"
identityv0 "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
"github.com/grafana/grafana/pkg/registry/apis/iam/common"
"github.com/grafana/grafana/pkg/registry/apis/iam/legacy"
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
"github.com/grafana/grafana/pkg/services/user"
)

@ -9,7 +9,7 @@ import (
"github.com/grafana/grafana/pkg/registry/apis/datasource"
"github.com/grafana/grafana/pkg/registry/apis/featuretoggle"
"github.com/grafana/grafana/pkg/registry/apis/folders"
"github.com/grafana/grafana/pkg/registry/apis/identity"
"github.com/grafana/grafana/pkg/registry/apis/iam"
"github.com/grafana/grafana/pkg/registry/apis/peakq"
"github.com/grafana/grafana/pkg/registry/apis/playlist"
"github.com/grafana/grafana/pkg/registry/apis/query"
@ -33,7 +33,7 @@ var WireSet = wire.NewSet(
featuretoggle.RegisterAPIService,
datasource.RegisterAPIService,
folders.RegisterAPIService,
identity.RegisterAPIService,
iam.RegisterAPIService,
peakq.RegisterAPIService,
service.RegisterAPIService,
query.RegisterAPIService,

@ -46,7 +46,7 @@ var pathRewriters = []filters.PathRewriter{
},
},
{
Pattern: regexp.MustCompile(`(/apis/identity.grafana.app/v0alpha1/namespaces/.*/display$)`),
Pattern: regexp.MustCompile(`(/apis/iam.grafana.app/v0alpha1/namespaces/.*/display$)`),
ReplaceFunc: func(matches []string) string {
return matches[1] + "/name" // connector requires a name
},

@ -15,13 +15,13 @@ import (
)
var gvrTeams = schema.GroupVersionResource{
Group: "identity.grafana.app",
Group: "iam.grafana.app",
Version: "v0alpha1",
Resource: "teams",
}
var gvrUsers = schema.GroupVersionResource{
Group: "identity.grafana.app",
Group: "iam.grafana.app",
Version: "v0alpha1",
Resource: "users",
}
@ -42,7 +42,7 @@ func TestIntegrationRequiresDevMode(t *testing.T) {
},
})
_, err := helper.NewDiscoveryClient().ServerResourcesForGroupVersion("identity.grafana.app/v0alpha1")
_, err := helper.NewDiscoveryClient().ServerResourcesForGroupVersion("iam.grafana.app/v0alpha1")
require.Error(t, err)
}
@ -57,7 +57,7 @@ func TestIntegrationIdentity(t *testing.T) {
featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs, // Required to start the example service
},
})
_, err := helper.NewDiscoveryClient().ServerResourcesForGroupVersion("identity.grafana.app/v0alpha1")
_, err := helper.NewDiscoveryClient().ServerResourcesForGroupVersion("iam.grafana.app/v0alpha1")
require.NoError(t, err)
t.Run("read only views", func(t *testing.T) {
@ -72,7 +72,7 @@ func TestIntegrationIdentity(t *testing.T) {
require.JSONEq(t, `{
"items": [
{
"apiVersion": "identity.grafana.app/v0alpha1",
"apiVersion": "iam.grafana.app/v0alpha1",
"kind": "Team",
"metadata": {
"annotations": {
Loading…
Cancel
Save