Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ import (
kubewaitingcontainerpb "github.com/gravitational/teleport/api/gen/proto/go/teleport/kubewaitingcontainer/v1"
loginrulepb "github.com/gravitational/teleport/api/gen/proto/go/teleport/loginrule/v1"
machineidv1pb "github.com/gravitational/teleport/api/gen/proto/go/teleport/machineid/v1"
mfav1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/mfa/v1"
notificationsv1pb "github.com/gravitational/teleport/api/gen/proto/go/teleport/notifications/v1"
oktapb "github.com/gravitational/teleport/api/gen/proto/go/teleport/okta/v1"
pluginspb "github.com/gravitational/teleport/api/gen/proto/go/teleport/plugins/v1"
Expand Down Expand Up @@ -673,9 +674,9 @@ type Config struct {
// MFAPromptConstructor is used to create MFA prompts when needed.
// If nil, the client will not prompt for MFA.
MFAPromptConstructor mfa.PromptConstructor
// SSOMFACeremonyConstructor is used to handle SSO MFA when needed.
// MFACeremonyConstructor is used to handle SSO or Browser MFA when needed.
// If nil, the client will not prompt for MFA.
SSOMFACeremonyConstructor mfa.SSOMFACeremonyConstructor
MFACeremonyConstructor mfa.MFACeremonyConstructor
}

// CheckAndSetDefaults checks and sets default config values.
Expand Down Expand Up @@ -742,9 +743,9 @@ func (c *Client) SetMFAPromptConstructor(pc mfa.PromptConstructor) {
c.c.MFAPromptConstructor = pc
}

// SetSSOMFACeremonyConstructor sets the SSO MFA ceremony constructor for this client.
func (c *Client) SetSSOMFACeremonyConstructor(scc mfa.SSOMFACeremonyConstructor) {
c.c.SSOMFACeremonyConstructor = scc
// SetMFACeremonyConstructor sets the MFA ceremony constructor for this client.
func (c *Client) SetMFACeremonyConstructor(mcc mfa.MFACeremonyConstructor) {
c.c.MFACeremonyConstructor = mcc
}

// Close closes the Client connection to the auth server.
Expand Down Expand Up @@ -5521,6 +5522,11 @@ func (c *Client) StableUNIXUsersClient() stableunixusersv1.StableUNIXUsersServic
return stableunixusersv1.NewStableUNIXUsersServiceClient(c.conn)
}

// MFAServiceClient returns a client for the MFA service.
func (c *Client) MFAServiceClient() mfav1.MFAServiceClient {
return mfav1.NewMFAServiceClient(c.conn)
}

// GetCertAuthority retrieves a CA by type and domain.
func (c *Client) GetCertAuthority(ctx context.Context, id types.CertAuthID, loadKeys bool) (types.CertAuthority, error) {
trust := c.TrustClient()
Expand Down
2 changes: 1 addition & 1 deletion api/client/mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (c *Client) PerformMFACeremony(ctx context.Context, challengeRequest *proto
mfaCeremony := &mfa.Ceremony{
CreateAuthenticateChallenge: c.CreateAuthenticateChallenge,
PromptConstructor: c.c.MFAPromptConstructor,
SSOMFACeremonyConstructor: c.c.SSOMFACeremonyConstructor,
MFACeremonyConstructor: c.c.MFACeremonyConstructor,
}
return mfaCeremony.Run(ctx, challengeRequest, promptOpts...)
}
3,145 changes: 1,969 additions & 1,176 deletions api/client/proto/authservice.pb.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions api/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ const (
// Github means authentication will happen remotely using a Github connector.
Github = "github"

// BrowserMFA is for CLI flows that delegate MFA to the browser.
BrowserMFA = "browser_mfa"

// HumanDateFormatSeconds is a human readable date formatting with seconds
HumanDateFormatSeconds = "Jan 2 2006 15:04:05 UTC"

Expand Down
Loading
Loading