Authenticator types provide functionality for authenticating users and adding the authenticated information to a context.
| 30 | // Authenticator types provide functionality for authenticating users and adding |
| 31 | // the authenticated information to a context. |
| 32 | type Authenticator interface { |
| 33 | // AuthInit will be called once when the ECU is run to set up required |
| 34 | // resources for authentication. If nothing is needed, it should simply |
| 35 | // return nil. If an error is returned, a warning will be |
| 36 | // logged but the ECU will continue to run, so implementations should ensure |
| 37 | // Authenticate does not crash if AuthInit fails. |
| 38 | AuthInit() error |
| 39 | |
| 40 | // Authenticate inspects the provided context (particularly ctx.AuthToken) |
| 41 | // and either returns an error or creates a child context treated as |
| 42 | // authenticated (ctx.AuthType == ipc.ATSSO) and fields needed for |
| 43 | // authorization checks (ctx.User). |
| 44 | Authenticate(ctx *ipc.Context) (*ipc.Context, error) |
| 45 | } |
| 46 | |
| 47 | // DefaultAuthenticator implements a "default-deny authenticator" that denies |
| 48 | // all authentications. Using this prevents remote connections to the ECU. |
no outgoing calls
no test coverage detected