Skip to content

Commit

Permalink
SCIM to Singleton (#183)
Browse files Browse the repository at this point in the history
* SCIM to singleton

* update

* v14 --> v15

* more v14 --> v15
  • Loading branch information
ollie-stytch authored Jun 3, 2024
1 parent 7ead4a8 commit 3a2826f
Show file tree
Hide file tree
Showing 100 changed files with 379 additions and 368 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/stytchauth/stytch-go/v14
module github.com/stytchauth/stytch-go/v15

go 1.18

Expand Down
8 changes: 4 additions & 4 deletions stytch/b2b/b2bstytchapi/b2bstytchapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"time"

"github.com/MicahParks/keyfunc/v2"
"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b"
"github.com/stytchauth/stytch-go/v14/stytch/config"
"github.com/stytchauth/stytch-go/v14/stytch/consumer"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b"
"github.com/stytchauth/stytch-go/v15/stytch/config"
"github.com/stytchauth/stytch-go/v15/stytch/consumer"
)

type Logger interface {
Expand Down
2 changes: 1 addition & 1 deletion stytch/b2b/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package b2b
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v15/stytch"
)

type DiscoveryClient struct {
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/discovery/intermediatesessions/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package intermediatesessions
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch/b2b/mfa"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/sessions"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/mfa"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/sessions"
)

// ExchangeParams: Request type for `IntermediateSessions.Exchange`.
Expand Down
8 changes: 4 additions & 4 deletions stytch/b2b/discovery/organizations/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ package organizations
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch/b2b/discovery"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/mfa"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/sessions"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/discovery"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/mfa"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/sessions"
)

// CreateParams: Request type for `Organizations.Create`.
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/discovery/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package discovery
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch/b2b/mfa"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/sessions"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/mfa"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/sessions"
)

// DiscoveredOrganization:
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/discovery_intermediatesessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"context"
"encoding/json"

"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/discovery/intermediatesessions"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/discovery/intermediatesessions"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type DiscoveryIntermediateSessionsClient struct {
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/discovery_organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"context"
"encoding/json"

"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/discovery/organizations"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/discovery/organizations"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type DiscoveryOrganizationsClient struct {
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/magiclinks.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"fmt"

"github.com/mitchellh/mapstructure"
"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/magiclinks"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/magiclinks"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type MagicLinksClient struct {
Expand Down
2 changes: 1 addition & 1 deletion stytch/b2b/magiclinks/discovery/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package discovery
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch/b2b/discovery"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/discovery"
)

// AuthenticateParams: Request type for `Discovery.Authenticate`.
Expand Down
4 changes: 2 additions & 2 deletions stytch/b2b/magiclinks/email/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package email
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v14/stytch/methodoptions"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v15/stytch/methodoptions"
)

// InviteParams: Request type for `Email.Invite`.
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/magiclinks/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package magiclinks
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch/b2b/mfa"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/sessions"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/mfa"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/sessions"
)

// AuthenticateParams: Request type for `MagicLinks.Authenticate`.
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/magiclinks_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"context"
"encoding/json"

"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/magiclinks/discovery"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/magiclinks/discovery"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type MagicLinksDiscoveryClient struct {
Expand Down
14 changes: 10 additions & 4 deletions stytch/b2b/magiclinks_email.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"context"
"encoding/json"

"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/magiclinks/email"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/magiclinks/email"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type MagicLinksEmailClient struct {
Expand All @@ -31,6 +31,8 @@ func NewMagicLinksEmailClient(c stytch.Client) *MagicLinksEmailClient {
// LoginOrSignup: Send either a login or signup magic link to a Member. A new, pending, or invited Member
// will receive a signup Email Magic Link. Members will have a `pending` status until they successfully
// authenticate. An active Member will receive a login Email Magic Link.
//
// The magic link is valid for 60 minutes.
func (c *MagicLinksEmailClient) LoginOrSignup(
ctx context.Context,
body *email.LoginOrSignupParams,
Expand Down Expand Up @@ -61,7 +63,11 @@ func (c *MagicLinksEmailClient) LoginOrSignup(

// Invite: Send an invite email to a new Member to join an Organization. The Member will be created with an
// `invited` status until they successfully authenticate. Sending invites to `pending` Members will update
// their status to `invited`. Sending invites to already `active` Members will return an error. /%}
// their status to `invited`. Sending invites to already `active` Members will return an error.
//
// The magic link invite will be valid for 1 week.
//
// /%}
func (c *MagicLinksEmailClient) Invite(
ctx context.Context,
body *email.InviteParams,
Expand Down
8 changes: 4 additions & 4 deletions stytch/b2b/magiclinks_email_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"context"
"encoding/json"

"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/magiclinks/email/discovery"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/magiclinks/email/discovery"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type MagicLinksEmailDiscoveryClient struct {
Expand All @@ -25,7 +25,7 @@ func NewMagicLinksEmailDiscoveryClient(c stytch.Client) *MagicLinksEmailDiscover
}
}

// Send a discovery magic link to an email address.
// Send a discovery magic link to an email address. The magic link is valid for 60 minutes.
func (c *MagicLinksEmailDiscoveryClient) Send(
ctx context.Context,
body *discovery.SendParams,
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"fmt"

"github.com/mitchellh/mapstructure"
"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/oauth"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/oauth"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type OAuthClient struct {
Expand Down
2 changes: 1 addition & 1 deletion stytch/b2b/oauth/discovery/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package discovery
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch/b2b/discovery"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/discovery"
)

// AuthenticateParams: Request type for `Discovery.Authenticate`.
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/oauth/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ package oauth
import (
"time"

"github.com/stytchauth/stytch-go/v14/stytch/b2b/mfa"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/sessions"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/mfa"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/sessions"
)

// AuthenticateParams: Request type for `OAuth.Authenticate`.
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/oauth_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"context"
"encoding/json"

"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/oauth/discovery"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/oauth/discovery"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type OAuthDiscoveryClient struct {
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"encoding/json"
"fmt"

"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type OrganizationsClient struct {
Expand Down
4 changes: 2 additions & 2 deletions stytch/b2b/organizations/members/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package members
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v14/stytch/methodoptions"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v15/stytch/methodoptions"
)

// CreateParams: Request type for `Members.Create`.
Expand Down
14 changes: 7 additions & 7 deletions stytch/b2b/organizations/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package organizations
import (
"time"

"github.com/stytchauth/stytch-go/v14/stytch/methodoptions"
"github.com/stytchauth/stytch-go/v15/stytch/methodoptions"
)

// ActiveSCIMConnection:
Expand Down Expand Up @@ -213,9 +213,6 @@ type Member struct {
// [RBAC guide](https://stytch.com/docs/b2b/guides/rbac/stytch-default) for more details on this Role.
IsAdmin bool `json:"is_admin,omitempty"`
TOTPRegistrationID string `json:"totp_registration_id,omitempty"`
// SCIMRegistrations: An array of scim member registrations, each one referencing a
// [SCIM Connection](scim-connection-object) object in use for the Member creation.
SCIMRegistrations []SCIMRegistration `json:"scim_registrations,omitempty"`
// MFAEnrolled: Sets whether the Member is enrolled in MFA. If true, the Member must complete an MFA step
// whenever they wish to log in to their Organization. If false, the Member only needs to complete an MFA
// step if the Organization's MFA policy is set to `REQUIRED_FOR_ALL`.
Expand Down Expand Up @@ -243,6 +240,9 @@ type Member struct {
// UpdatedAt: The timestamp of when the Member was last updated. Values conform to the RFC 3339 standard
// and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`.
UpdatedAt *time.Time `json:"updated_at,omitempty"`
// SCIMRegistration: A scim member registration, referencing a [SCIM Connection](scim-connection-object)
// object in use for the Member creation.
SCIMRegistration *SCIMRegistration `json:"scim_registration,omitempty"`
}

// MemberRole:
Expand Down Expand Up @@ -450,9 +450,6 @@ type Organization struct {
// The list's accepted values are: `sms_otp` and `totp`.
//
AllowedMFAMethods []string `json:"allowed_mfa_methods,omitempty"`
// SCIMActiveConnections: An array of active
// [SCIM Connection references](https://stytch.com/docs/b2b/api/scim-connection-object).
SCIMActiveConnections []ActiveSCIMConnection `json:"scim_active_connections,omitempty"`
// TrustedMetadata: An arbitrary JSON object for storing application-specific data or
// identity-provider-specific data.
TrustedMetadata map[string]any `json:"trusted_metadata,omitempty"`
Expand All @@ -464,6 +461,9 @@ type Organization struct {
UpdatedAt *time.Time `json:"updated_at,omitempty"`
// SSODefaultConnectionID: The default connection used for SSO when there are multiple active connections.
SSODefaultConnectionID string `json:"sso_default_connection_id,omitempty"`
// SCIMActiveConnection: An active
// [SCIM Connection references](https://stytch.com/docs/b2b/api/scim-connection-object).
SCIMActiveConnection *ActiveSCIMConnection `json:"scim_active_connection,omitempty"`
}

// ResultsMetadata:
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/organizations_members.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"encoding/json"
"fmt"

"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations/members"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations/members"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type OrganizationsMembersClient struct {
Expand Down
4 changes: 2 additions & 2 deletions stytch/b2b/organizations_members_oauthproviders.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"context"
"fmt"

"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations/members/oauthproviders"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations/members/oauthproviders"
)

type OrganizationsMembersOAuthProvidersClient struct {
Expand Down
2 changes: 1 addition & 1 deletion stytch/b2b/otp.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package b2b
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v15/stytch"
)

type OTPsClient struct {
Expand Down
4 changes: 2 additions & 2 deletions stytch/b2b/otp/sms/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package sms
// !!!

import (
"github.com/stytchauth/stytch-go/v14/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/sessions"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/organizations"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/sessions"
)

// AuthenticateParams: Request type for `Sms.Authenticate`.
Expand Down
6 changes: 3 additions & 3 deletions stytch/b2b/otp_sms.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"fmt"

"github.com/mitchellh/mapstructure"
"github.com/stytchauth/stytch-go/v14/stytch"
"github.com/stytchauth/stytch-go/v14/stytch/b2b/otp/sms"
"github.com/stytchauth/stytch-go/v14/stytch/stytcherror"
"github.com/stytchauth/stytch-go/v15/stytch"
"github.com/stytchauth/stytch-go/v15/stytch/b2b/otp/sms"
"github.com/stytchauth/stytch-go/v15/stytch/stytcherror"
)

type OTPsSmsClient struct {
Expand Down
Loading

0 comments on commit 3a2826f

Please sign in to comment.