mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:47:32 +00:00
feat: provide instance info on admin api and return version on instances responses (admin and system api) (#3802)
* feat: provide instance info on admin api and return version on instances responses (admin and system api) * fix GetMyInstance
This commit is contained in:
@@ -56,16 +56,28 @@ Set the default language
|
|||||||
GET: /languages/default
|
GET: /languages/default
|
||||||
|
|
||||||
|
|
||||||
|
### GetMyInstance
|
||||||
|
|
||||||
|
> **rpc** GetMyInstance([GetMyInstanceRequest](#getmyinstancerequest))
|
||||||
|
[GetMyInstanceResponse](#getmyinstanceresponse)
|
||||||
|
|
||||||
|
Returns the details of the instance
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
GET: /instances/me
|
||||||
|
|
||||||
|
|
||||||
### ListInstanceDomains
|
### ListInstanceDomains
|
||||||
|
|
||||||
> **rpc** ListInstanceDomains([ListInstanceDomainsRequest](#listinstancedomainsrequest))
|
> **rpc** ListInstanceDomains([ListInstanceDomainsRequest](#listinstancedomainsrequest))
|
||||||
[ListInstanceDomainsResponse](#listinstancedomainsresponse)
|
[ListInstanceDomainsResponse](#listinstancedomainsresponse)
|
||||||
|
|
||||||
Returns the domains of an instance
|
Returns the domains of the instance
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GET: /domains
|
POST: /domains/_search
|
||||||
|
|
||||||
|
|
||||||
### ListSecretGenerators
|
### ListSecretGenerators
|
||||||
@@ -2348,6 +2360,23 @@ This is an empty request
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GetMyInstanceRequest
|
||||||
|
This is an empty request
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### GetMyInstanceResponse
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| Field | Type | Description | Validation |
|
||||||
|
| ----- | ---- | ----------- | ----------- |
|
||||||
|
| instance | zitadel.instance.v1.InstanceDetail | - | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### GetOIDCSettingsRequest
|
### GetOIDCSettingsRequest
|
||||||
This is an empty request
|
This is an empty request
|
||||||
|
|
||||||
|
@@ -8,7 +8,17 @@ import (
|
|||||||
admin_pb "github.com/zitadel/zitadel/pkg/grpc/admin"
|
admin_pb "github.com/zitadel/zitadel/pkg/grpc/admin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Server) GetInstanceDomains(ctx context.Context, req *admin_pb.ListInstanceDomainsRequest) (*admin_pb.ListInstanceDomainsResponse, error) {
|
func (s *Server) GetMyInstance(ctx context.Context, _ *admin_pb.GetMyInstanceRequest) (*admin_pb.GetMyInstanceResponse, error) {
|
||||||
|
instance, err := s.query.Instance(ctx, true)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &admin_pb.GetMyInstanceResponse{
|
||||||
|
Instance: instance_grpc.InstanceDetailToPb(instance),
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Server) ListInstanceDomains(ctx context.Context, req *admin_pb.ListInstanceDomainsRequest) (*admin_pb.ListInstanceDomainsResponse, error) {
|
||||||
queries, err := ListInstanceDomainsRequestToModel(req)
|
queries, err := ListInstanceDomainsRequestToModel(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package org
|
package org
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/zitadel/zitadel/cmd/build"
|
||||||
"github.com/zitadel/zitadel/internal/api/grpc/object"
|
"github.com/zitadel/zitadel/internal/api/grpc/object"
|
||||||
"github.com/zitadel/zitadel/internal/errors"
|
"github.com/zitadel/zitadel/internal/errors"
|
||||||
"github.com/zitadel/zitadel/internal/query"
|
"github.com/zitadel/zitadel/internal/query"
|
||||||
@@ -26,6 +27,7 @@ func InstanceToPb(instance *query.Instance) *instance_pb.Instance {
|
|||||||
Id: instance.InstanceID(),
|
Id: instance.InstanceID(),
|
||||||
Name: instance.Name,
|
Name: instance.Name,
|
||||||
Domains: DomainsToPb(instance.Domains),
|
Domains: DomainsToPb(instance.Domains),
|
||||||
|
Version: build.Version(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +42,7 @@ func InstanceDetailToPb(instance *query.Instance) *instance_pb.InstanceDetail {
|
|||||||
Id: instance.InstanceID(),
|
Id: instance.InstanceID(),
|
||||||
Name: instance.Name,
|
Name: instance.Name,
|
||||||
Domains: DomainsToPb(instance.Domains),
|
Domains: DomainsToPb(instance.Domains),
|
||||||
|
Version: build.Version(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -184,10 +184,21 @@ service AdminService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the domains of an instance
|
// Returns the details of the instance
|
||||||
|
rpc GetMyInstance(GetMyInstanceRequest) returns (GetMyInstanceResponse) {
|
||||||
|
option (google.api.http) = {
|
||||||
|
get: "/instances/me";
|
||||||
|
};
|
||||||
|
|
||||||
|
option (zitadel.v1.auth_option) = {
|
||||||
|
permission: "iam.read";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns the domains of the instance
|
||||||
rpc ListInstanceDomains(ListInstanceDomainsRequest) returns (ListInstanceDomainsResponse) {
|
rpc ListInstanceDomains(ListInstanceDomainsRequest) returns (ListInstanceDomainsResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
get: "/domains";
|
post: "/domains/_search";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2664,6 +2675,13 @@ message GetDefaultOrgResponse {
|
|||||||
zitadel.org.v1.Org org = 1;
|
zitadel.org.v1.Org org = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//This is an empty request
|
||||||
|
message GetMyInstanceRequest {}
|
||||||
|
|
||||||
|
message GetMyInstanceResponse {
|
||||||
|
zitadel.instance.v1.InstanceDetail instance = 1;
|
||||||
|
}
|
||||||
|
|
||||||
message ListInstanceDomainsRequest {
|
message ListInstanceDomainsRequest {
|
||||||
zitadel.v1.ListQuery query = 1;
|
zitadel.v1.ListQuery query = 1;
|
||||||
// the field the result is sorted
|
// the field the result is sorted
|
||||||
|
Reference in New Issue
Block a user