-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update generator to generate User client v2 (#381)
This PR generates the missing V2 of the user client as mentioned in #373 v2beta is deprecated and is throwing warnings when using the client. This adds the GA v2 client without breaking the applications that are already on v2beta Biggest change other than adding the generated code is to add a methods to `pkg/client/client.go` to support the new client versions ### Definition of Ready - [x] I am happy with the code - [x] Short description of the feature/issue is added in the pr description - [x] PR is linked to the corresponding user story - [x] Acceptance criteria are met - [x] All open todos and follow ups are defined in a new ticket and justified - [x] Deviations from the acceptance criteria and design are agreed with the PO and documented. - [x] No debug or dead code - [x] My code has no repetitions - [ ] Critical parts are tested automatically - [x] Where possible E2E tests are implemented - [x] Documentation/examples are up-to-date - [x] All non-functional requirements are met - [x] Functionality of the acceptance criteria is checked manually on the dev system.
- Loading branch information
Showing
39 changed files
with
30,386 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package v2 | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/zitadel/zitadel-go/v3/pkg/client/zitadel" | ||
oidc "github.com/zitadel/zitadel-go/v3/pkg/client/zitadel/oidc/v2" | ||
) | ||
|
||
type Client struct { | ||
Connection *zitadel.Connection | ||
oidc.OIDCServiceClient | ||
} | ||
|
||
func NewClient(ctx context.Context, issuer, api string, scopes []string, options ...zitadel.Option) (*Client, error) { | ||
conn, err := zitadel.NewConnection(ctx, issuer, api, scopes, options...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &Client{ | ||
Connection: conn, | ||
OIDCServiceClient: oidc.NewOIDCServiceClient(conn.ClientConn), | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package v2 | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/zitadel/zitadel-go/v3/pkg/client/zitadel" | ||
org "github.com/zitadel/zitadel-go/v3/pkg/client/zitadel/org/v2" | ||
) | ||
|
||
type Client struct { | ||
Connection *zitadel.Connection | ||
org.OrganizationServiceClient | ||
} | ||
|
||
func NewClient(ctx context.Context, issuer, api string, scopes []string, options ...zitadel.Option) (*Client, error) { | ||
conn, err := zitadel.NewConnection(ctx, issuer, api, scopes, options...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &Client{ | ||
Connection: conn, | ||
OrganizationServiceClient: org.NewOrganizationServiceClient(conn.ClientConn), | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package v2 | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/zitadel/zitadel-go/v3/pkg/client/zitadel" | ||
session "github.com/zitadel/zitadel-go/v3/pkg/client/zitadel/session/v2" | ||
) | ||
|
||
type Client struct { | ||
Connection *zitadel.Connection | ||
session.SessionServiceClient | ||
} | ||
|
||
func NewClient(ctx context.Context, issuer, api string, scopes []string, options ...zitadel.Option) (*Client, error) { | ||
conn, err := zitadel.NewConnection(ctx, issuer, api, scopes, options...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &Client{ | ||
Connection: conn, | ||
SessionServiceClient: session.NewSessionServiceClient(conn.ClientConn), | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package v2 | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/zitadel/zitadel-go/v3/pkg/client/zitadel" | ||
settings "github.com/zitadel/zitadel-go/v3/pkg/client/zitadel/settings/v2" | ||
) | ||
|
||
type Client struct { | ||
Connection *zitadel.Connection | ||
settings.SettingsServiceClient | ||
} | ||
|
||
func NewClient(ctx context.Context, issuer, api string, scopes []string, options ...zitadel.Option) (*Client, error) { | ||
conn, err := zitadel.NewConnection(ctx, issuer, api, scopes, options...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &Client{ | ||
Connection: conn, | ||
SettingsServiceClient: settings.NewSettingsServiceClient(conn.ClientConn), | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package v2 | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/zitadel/zitadel-go/v3/pkg/client/zitadel" | ||
user "github.com/zitadel/zitadel-go/v3/pkg/client/zitadel/user/v2" | ||
) | ||
|
||
type Client struct { | ||
Connection *zitadel.Connection | ||
user.UserServiceClient | ||
} | ||
|
||
func NewClient(ctx context.Context, issuer, api string, scopes []string, options ...zitadel.Option) (*Client, error) { | ||
conn, err := zitadel.NewConnection(ctx, issuer, api, scopes, options...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &Client{ | ||
Connection: conn, | ||
UserServiceClient: user.NewUserServiceClient(conn.ClientConn), | ||
}, nil | ||
} |
Oops, something went wrong.