Obtains principals for test scenarios This triggers rebuild of the principals if invalid, intended to simulate an auth on _changes
(t *testing.T, auth *Authenticator)
| 1490 | // Obtains principals for test scenarios |
| 1491 | // This triggers rebuild of the principals if invalid, intended to simulate an auth on _changes |
| 1492 | func getPrincipals(t *testing.T, auth *Authenticator) (*userImpl, Principal) { |
| 1493 | principal, err := auth.GetPrincipal("alice", true) |
| 1494 | assert.NoError(t, err) |
| 1495 | userPrincipal, ok := principal.(*userImpl) |
| 1496 | assert.True(t, ok) |
| 1497 | rolePrincipal, err := auth.GetPrincipal("foo", false) |
| 1498 | assert.NoError(t, err) |
| 1499 | return userPrincipal, rolePrincipal |
| 1500 | } |
| 1501 | |
| 1502 | // Initializes principals and returns them for scenarios |
| 1503 | func initializeScenario(t *testing.T, auth *Authenticator) { |
no test coverage detected