fleet/changes
Lucas Manuel Rodriguez 57816592ba
Add read replica testing helpers and fix non-sso login bug (#4908)
not set on the INSERT.
- OUT: Only sets the ID on the passed session and returns it. (`CreatedAt`, `AccessedAt`, are not set.)

New version:

```go
func (ds *Datastore) NewSession(ctx context.Context, userID uint, sessionKey string) (*fleet.Session, error) {
	sqlStatement := `
		INSERT INTO sessions (
			user_id,
			` + "`key`" + `
		)
		VALUES(?,?)
	`
	result, err := ds.writer.ExecContext(ctx, sqlStatement, userID, sessionKey)
	if err != nil {
		return nil, ctxerr.Wrap(ctx, err, "inserting session")
	}

	id, _ := result.LastInsertId() // cannot fail with the mysql driver
	return ds.sessionByID(ctx, ds.writer, uint(id))
}
```

- IN: Define arguments that are truly used when creating a session.
- OUT: Load and return the fleet.Session struct with all values set (using the `ds.writer` to support read replicas correctly).

PS: The new `NewSession` version mimics what we already do with other entities, like policies (`Datastore.NewGlobalPolicy`).
2022-04-04 16:52:05 -07:00
..
.keep Issue 1009 calculate diff software (#1305) 2021-07-08 13:57:43 -03:00
issue-2814-export-hosts-as-csv Manage Host Page: Export hosts as CSV (#4917) 2022-04-04 14:53:14 -04:00
issue-2825-os-versions Add os versions endpoint (#4749) 2022-03-28 09:15:45 -06:00
issue-3573-remove-enroll-secrets-from-settings-page Remove viewing enroll secrets on app settings page, add changelog (#4896) 2022-04-04 12:27:13 -04:00
issue-4214-vulnerabilities-column Host Details Page: Software vulnerability column (#4836) 2022-04-04 12:33:02 -04:00
issue-4469-read-replica-non-sso-login Add read replica testing helpers and fix non-sso login bug (#4908) 2022-04-04 16:52:05 -07:00
issue-4537-accessibility-through-tabbing UI Accessibility: Ability to tab through app (#4699) 2022-03-28 17:31:36 -04:00
issue-4792-download-tmp fix rename tmp file (#4862) 2022-04-01 09:03:11 -06:00
issue-4799-fix-table-headers Fix table headers showing or misaligned when selection is active (#4892) 2022-03-31 16:10:11 -05:00
issue-4807-fleet-desktop-windows Orbit: Add Fleet Desktop support to Windows (#4873) 2022-04-01 17:28:51 -03:00
issue-4846-add-jira-integrations-config Add Jira integrations config support (#4863) 2022-03-30 09:10:02 -04:00