Documentation ¶
Index ¶
- Constants
- Variables
- func ExtractCSVHeaderField(fieldPointer []*FieldPointer) (headerFields []string, err error)
- func TraverseRecordValue(jsonMap interface{}, pointer string) (fieldValue string, err error)
- type Address
- type CSVField
- type FieldPointer
- type HTTPClient
- type Identity
- type IdentityLDAP
- type IdentityLoginID
- type IdentityOAuth
- type Logger
- type MFA
- type MFATOTP
- type Record
- type Request
- type Response
- type Result
- type UserExportCloudStorage
- type UserExportService
- func (s *UserExportService) ExportRecords(ctx context.Context, request *Request, task *redisqueue.Task) (outputFilename string, err error)
- func (s *UserExportService) ExportToCSV(ctx context.Context, tmpResult *os.File, request *Request, ...) (err error)
- func (s *UserExportService) ExportToNDJson(ctx context.Context, tmpResult *os.File, request *Request, ...) (err error)
- func (s *UserExportService) ParseExportRequest(w http.ResponseWriter, r *http.Request) (*Request, error)
- func (s *UserExportService) UploadResult(ctx context.Context, key string, resultFile *os.File, format string) (response *http.Response, err error)
- type UserQueries
Constants ¶
View Source
const BatchSize = 1000
View Source
const PresignGetExpiresForUserExport time.Duration = 1 * duration.PerMinute
PresignGetExpiresForUserExport is how long the presign GET request remains valid for user export.
Variables ¶
View Source
var DependencySet = wire.NewSet( NewCloudStorage, NewHTTPClient, wire.Struct(new(UserExportService), "*"), NewLogger, )
View Source
var ErrUserExportDisabled = apierrors.InternalError.WithReason("UserExportDisabled").New("User export disabled")
View Source
var ErrUserExportDuplicateField = apierrors.Invalid.WithReason("UserExportNonUniqueFieldNames")
Functions ¶
func ExtractCSVHeaderField ¶
func ExtractCSVHeaderField(fieldPointer []*FieldPointer) (headerFields []string, err error)
func TraverseRecordValue ¶
Types ¶
type CSVField ¶
type CSVField struct {
Fields []*FieldPointer `json:"fields,omitempty"`
}
type FieldPointer ¶
type HTTPClient ¶
func NewHTTPClient ¶
func NewHTTPClient() HTTPClient
type Identity ¶
type Identity struct { Type model.IdentityType `json:"type"` LoginID *IdentityLoginID `json:"login_id,omitempty"` OAuth *IdentityOAuth `json:"oauth,omitempty"` LDAP *IdentityLDAP `json:"ldap,omitempty"` Claims map[string]interface{} `json:"claims,omitempty"` }
type IdentityLDAP ¶
type IdentityLDAP struct { ServerName string `json:"server_name,omitempty"` LastLoginUsername string `json:"last_login_username,omitempty"` UserIDAttributeName string `json:"user_id_attribute_name,omitempty"` UserIDAttributeValue string `json:"user_id_attribute_value,omitempty"` Attributes map[string]interface{} `json:"attributes,omitempty"` }
type IdentityLoginID ¶
type IdentityOAuth ¶
type Record ¶
type Record struct { Sub string `json:"sub,omitempty"` PreferredUsername string `json:"preferred_username,omitempty"` Email string `json:"email,omitempty"` PhoneNumber string `json:"phone_number,omitempty"` EmailVerified bool `json:"email_verified"` PhoneNumberVerified bool `json:"phone_number_verified"` Name string `json:"name,omitempty"` GivenName string `json:"given_name,omitempty"` FamilyName string `json:"family_name,omitempty"` MiddleName string `json:"middle_name,omitempty"` Nickname string `json:"nickname,omitempty"` Profile string `json:"profile,omitempty"` Picture string `json:"picture,omitempty"` Website string `json:"website,omitempty"` Gender string `json:"gender,omitempty"` Birthdate string `json:"birthdate,omitempty"` Zoneinfo string `json:"zoneinfo,omitempty"` Locale string `json:"locale,omitempty"` Address *Address `json:"address,omitempty"` CustomAttributes map[string]interface{} `json:"custom_attributes,omitempty"` Roles []string `json:"roles,omitempty"` Groups []string `json:"groups,omitempty"` Disabled bool `json:"disabled"` DeleteAt *time.Time `json:"delete_at,omitempty"` Identities []*Identity `json:"identities,omitempty"` Mfa *MFA `json:"mfa,omitempty"` BiometricCount int `json:"biometric_count"` PasskeyCount int `json:"passkey_count"` }
type Response ¶
type Response struct { ID string `json:"id,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` CompletedAt *time.Time `json:"completed_at,omitempty"` FailedAt *time.Time `json:"failed_at,omitempty"` Status redisqueue.TaskStatus `json:"status,omitempty"` Request *Request `json:"request,omitempty"` DownloadUrl string `json:"download_url,omitempty"` Error *apierrors.APIError `json:"error,omitempty"` }
func NewResponseFromTask ¶
func NewResponseFromTask(task *redisqueue.Task) (*Response, error)
type UserExportCloudStorage ¶
type UserExportCloudStorage interface { PresignPutObject(ctx context.Context, name string, header http.Header) (*http.Request, error) PresignGetObject(ctx context.Context, name string, expire time.Duration) (*url.URL, error) }
func NewCloudStorage ¶
func NewCloudStorage(objectStoreConfig *config.UserExportObjectStoreConfig, c clock.Clock) UserExportCloudStorage
type UserExportService ¶
type UserExportService struct { AppDatabase *appdb.Handle Config *config.UserProfileConfig UserQueries UserQueries Logger Logger HTTPOrigin httputil.HTTPOrigin HTTPClient HTTPClient CloudStorage UserExportCloudStorage Clock clock.Clock }
func (*UserExportService) ExportRecords ¶
func (s *UserExportService) ExportRecords(ctx context.Context, request *Request, task *redisqueue.Task) (outputFilename string, err error)
func (*UserExportService) ExportToCSV ¶
func (s *UserExportService) ExportToCSV(ctx context.Context, tmpResult *os.File, request *Request, task *redisqueue.Task) (err error)
func (*UserExportService) ExportToNDJson ¶
func (s *UserExportService) ExportToNDJson(ctx context.Context, tmpResult *os.File, request *Request, task *redisqueue.Task) (err error)
func (*UserExportService) ParseExportRequest ¶
func (s *UserExportService) ParseExportRequest(w http.ResponseWriter, r *http.Request) (*Request, error)
Click to show internal directories.
Click to hide internal directories.