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)
| 1593 | // resource name. Returns empty when the caller has no workspace context yet |
| 1594 | // (SaaS brand-new signup flow). |
| 1595 | func 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. |
| 1603 | func generateEmailCode() (string, error) { |
no test coverage detected