Skip to content

Commit

Permalink
feat: add v2beta endpoints (#258)
Browse files Browse the repository at this point in the history
Added more v2beta endpoints: oidc/org/settings/user
  • Loading branch information
kalebscholes authored Oct 19, 2023
1 parent 084809f commit 2d273bd
Show file tree
Hide file tree
Showing 28 changed files with 15,353 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build/zitadel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ RUN ./build/zitadel/generate-grpc-client.sh ${PROJECT_PATH} \
&& mv /go/src/github.com/zitadel/zitadel/pkg/grpc/auth/auth_grpc.pb.go /zitadel-api/go/src/${PROJECT_PATH}/zitadel/auth/ \
&& mv /go/src/github.com/zitadel/zitadel/pkg/grpc/management/management_grpc.pb.go /zitadel-api/go/src/${PROJECT_PATH}/zitadel/management/ \
&& mv /go/src/github.com/zitadel/zitadel/pkg/grpc/system/system_grpc.pb.go /zitadel-api/go/src/${PROJECT_PATH}/zitadel/system/ \
&& mv /go/src/github.com/zitadel/zitadel/pkg/grpc/session/v2beta/*.pb.go /zitadel-api/go/src/${PROJECT_PATH}/zitadel/session/v2beta/
&& mv /go/src/github.com/zitadel/zitadel/pkg/grpc/session/v2beta/*.pb.go /zitadel-api/go/src/${PROJECT_PATH}/zitadel/session/v2beta/ \
&& mv /go/src/github.com/zitadel/zitadel/pkg/grpc/oidc/v2beta/*.pb.go /zitadel-api/go/src/${PROJECT_PATH}/zitadel/oidc/v2beta/ \
&& mv /go/src/github.com/zitadel/zitadel/pkg/grpc/org/v2beta/*.pb.go /zitadel-api/go/src/${PROJECT_PATH}/zitadel/org/v2beta/ \
&& mv /go/src/github.com/zitadel/zitadel/pkg/grpc/settings/v2beta/*.pb.go /zitadel-api/go/src/${PROJECT_PATH}/zitadel/settings/v2beta/ \
&& mv /go/src/github.com/zitadel/zitadel/pkg/grpc/user/v2beta/*.pb.go /zitadel-api/go/src/${PROJECT_PATH}/zitadel/user/v2beta/
#######################
## prepare generated files for output
#######################
Expand Down
18 changes: 18 additions & 0 deletions build/zitadel/generate-grpc-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ protoc \
--go_opt=Mzitadel/session/v2beta/challenge.proto=${ZITADEL_IMPORT}/session/v2beta \
--go_opt=Mzitadel/session/v2beta/session.proto=${ZITADEL_IMPORT}/session/v2beta \
--go_opt=Mzitadel/session/v2beta/session_service.proto=${ZITADEL_IMPORT}/session/v2beta \
--go_opt=Mzitadel/oidc/v2beta/authorization.proto=${ZITADEL_IMPORT}/oidc/v2beta \
--go_opt=Mzitadel/oidc/v2beta/oidc_service.proto=${ZITADEL_IMPORT}/oidc/v2beta \
--go_opt=Mzitadel/org/v2beta/org_service.proto=${ZITADEL_IMPORT}/org/v2beta \
--go_opt=Mzitadel/settings/v2beta/branding_settings.proto=${ZITADEL_IMPORT}/settings/v2beta \
--go_opt=Mzitadel/settings/v2beta/domain_settings.proto=${ZITADEL_IMPORT}/settings/v2beta \
--go_opt=Mzitadel/settings/v2beta/legal_settings.proto=${ZITADEL_IMPORT}/settings/v2beta \
--go_opt=Mzitadel/settings/v2beta/lockout_settings.proto=${ZITADEL_IMPORT}/settings/v2beta \
--go_opt=Mzitadel/settings/v2beta/login_settings.proto=${ZITADEL_IMPORT}/settings/v2beta \
--go_opt=Mzitadel/settings/v2beta/password_settings.proto=${ZITADEL_IMPORT}/settings/v2beta \
--go_opt=Mzitadel/settings/v2beta/settings.proto=${ZITADEL_IMPORT}/settings/v2beta \
--go_opt=Mzitadel/settings/v2beta/settings_service.proto=${ZITADEL_IMPORT}/settings/v2beta \
--go_opt=Mzitadel/user/v2beta/auth.proto=${ZITADEL_IMPORT}/user/v2beta \
--go_opt=Mzitadel/user/v2beta/email.proto=${ZITADEL_IMPORT}/user/v2beta \
--go_opt=Mzitadel/user/v2beta/idp.proto=${ZITADEL_IMPORT}/user/v2beta \
--go_opt=Mzitadel/user/v2beta/password.proto=${ZITADEL_IMPORT}/user/v2beta \
--go_opt=Mzitadel/user/v2beta/phone.proto=${ZITADEL_IMPORT}/user/v2beta \
--go_opt=Mzitadel/user/v2beta/user.proto=${ZITADEL_IMPORT}/user/v2beta \
--go_opt=Mzitadel/user/v2beta/user_service.proto=${ZITADEL_IMPORT}/user/v2beta \
--go_out /go/src \
--go-grpc_out /go/src \
$(find /proto/include/zitadel -iname *.proto)
24 changes: 24 additions & 0 deletions pkg/client/oidc/v2beta/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package v2beta

import (
"github.com/zitadel/zitadel-go/v2/pkg/client/zitadel"
oidc "github.com/zitadel/zitadel-go/v2/pkg/client/zitadel/oidc/v2beta"
)

type Client struct {
Connection *zitadel.Connection
oidc.OIDCServiceClient
}

func NewClient(issuer, api string, scopes []string, options ...zitadel.Option) (*Client, error) {

conn, err := zitadel.NewConnection(issuer, api, scopes, options...)
if err != nil {
return nil, err
}

return &Client{
Connection: conn,
OIDCServiceClient: oidc.NewOIDCServiceClient(conn.ClientConn),
}, nil
}
24 changes: 24 additions & 0 deletions pkg/client/org/v2beta/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package v2beta

import (
"github.com/zitadel/zitadel-go/v2/pkg/client/zitadel"
org "github.com/zitadel/zitadel-go/v2/pkg/client/zitadel/org/v2beta"
)

type Client struct {
Connection *zitadel.Connection
org.OrganizationServiceClient
}

func NewClient(issuer, api string, scopes []string, options ...zitadel.Option) (*Client, error) {

conn, err := zitadel.NewConnection(issuer, api, scopes, options...)
if err != nil {
return nil, err
}

return &Client{
Connection: conn,
OrganizationServiceClient: org.NewOrganizationServiceClient(conn.ClientConn),
}, nil
}
24 changes: 24 additions & 0 deletions pkg/client/settings/v2beta/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package v2beta

import (
"github.com/zitadel/zitadel-go/v2/pkg/client/zitadel"
settings "github.com/zitadel/zitadel-go/v2/pkg/client/zitadel/settings/v2beta"
)

type Client struct {
Connection *zitadel.Connection
settings.SettingsServiceClient
}

func NewClient(issuer, api string, scopes []string, options ...zitadel.Option) (*Client, error) {

conn, err := zitadel.NewConnection(issuer, api, scopes, options...)
if err != nil {
return nil, err
}

return &Client{
Connection: conn,
SettingsServiceClient: settings.NewSettingsServiceClient(conn.ClientConn),
}, nil
}
24 changes: 24 additions & 0 deletions pkg/client/user/v2beta/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package v2beta

import (
"github.com/zitadel/zitadel-go/v2/pkg/client/zitadel"
user "github.com/zitadel/zitadel-go/v2/pkg/client/zitadel/user/v2beta"
)

type Client struct {
Connection *zitadel.Connection
user.UserServiceClient
}

func NewClient(issuer, api string, scopes []string, options ...zitadel.Option) (*Client, error) {

conn, err := zitadel.NewConnection(issuer, api, scopes, options...)
if err != nil {
return nil, err
}

return &Client{
Connection: conn,
UserServiceClient: user.NewUserServiceClient(conn.ClientConn),
}, nil
}
Loading

0 comments on commit 2d273bd

Please sign in to comment.