MCPcopy Create free account
hub / github.com/bytebase/bytebase / parseOptionalWorkspace

Function parseOptionalWorkspace

backend/api/v1/auth_service.go:1595–1600  ·  view source on GitHub ↗

parseOptionalWorkspace extracts the workspace ID from an optional "workspaces/{id}" resource name. Returns empty when the caller has no workspace context yet (SaaS brand-new signup flow).

(name *string)

Source from the content-addressed store, hash-verified

1593// resource name. Returns empty when the caller has no workspace context yet
1594// (SaaS brand-new signup flow).
1595func parseOptionalWorkspace(name *string) (string, error) {
1596 if name == nil || *name == "" {
1597 return "", nil
1598 }
1599 return common.GetWorkspaceID(*name)
1600}
1601
1602// generateEmailCode returns a cryptographically-random 6-digit numeric code.
1603func generateEmailCode() (string, error) {

Callers 3

LoginMethod · 0.85
SendEmailLoginCodeMethod · 0.85

Calls 1

GetWorkspaceIDFunction · 0.92

Tested by

no test coverage detected