outposts/ldap: fix linting

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-26 12:24:46 +02:00
parent d741ed430a
commit dcd80c6d63
3 changed files with 11 additions and 10 deletions

View File

@ -52,13 +52,14 @@ func main() {
ac.Server = ldap.NewServer(ac)
ac.Start()
err = ac.Start()
if err != nil {
log.WithError(err).Panic("Failed to run server")
}
for {
select {
case <-interrupt:
ac.Shutdown()
os.Exit(0)
}
<-interrupt
ac.Shutdown()
os.Exit(0)
}
}

View File

@ -8,11 +8,11 @@ func AKAttrsToLDAP(attrs interface{}) []*ldap.EntryAttribute {
attrList := []*ldap.EntryAttribute{}
for attrKey, attrValue := range attrs.(map[string]interface{}) {
entry := &ldap.EntryAttribute{Name: attrKey}
switch attrValue.(type) {
switch t := attrValue.(type) {
case []string:
entry.Values = attrValue.([]string)
entry.Values = t
case string:
entry.Values = []string{attrValue.(string)}
entry.Values = []string{t}
}
attrList = append(attrList, entry)
}

View File

@ -1,4 +1,4 @@
import { CryptoApi, FlowDesignationEnum, FlowsApi, ProvidersApi, LDAPProvider } from "authentik-api";
import { FlowDesignationEnum, FlowsApi, ProvidersApi, LDAPProvider } from "authentik-api";
import { t } from "@lingui/macro";
import { customElement, property } from "lit-element";
import { html, TemplateResult } from "lit-html";