Provision sets up the adminAPI module.
(ctx caddy.Context)
| 47 | |
| 48 | // Provision sets up the adminAPI module. |
| 49 | func (a *adminAPI) Provision(ctx caddy.Context) error { |
| 50 | a.ctx = ctx |
| 51 | a.log = ctx.Logger(a) // TODO: passing in 'a' is a hack until the admin API is officially extensible (see #5032) |
| 52 | |
| 53 | // Avoid initializing PKI if it wasn't configured. |
| 54 | // We intentionally ignore the error since it's not |
| 55 | // fatal if the PKI app is not explicitly configured. |
| 56 | pkiApp, err := ctx.AppIfConfigured("pki") |
| 57 | if err == nil { |
| 58 | a.pkiApp = pkiApp.(*PKI) |
| 59 | } |
| 60 | |
| 61 | return nil |
| 62 | } |
| 63 | |
| 64 | // Routes returns the admin routes for the PKI app. |
| 65 | func (a *adminAPI) Routes() []caddy.AdminRoute { |
nothing calls this directly
no test coverage detected