mirror of
https://github.com/documize/community.git
synced 2025-07-18 20:59:43 +02:00
Linting
This commit is contained in:
parent
32dbab826d
commit
4f248bf018
5 changed files with 15 additions and 19 deletions
|
@ -4,6 +4,11 @@ import (
|
|||
"database/sql"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/documize/community/core/env"
|
||||
"github.com/documize/community/core/response"
|
||||
"github.com/documize/community/core/secrets"
|
||||
|
@ -16,10 +21,6 @@ import (
|
|||
ath "github.com/documize/community/model/auth"
|
||||
"github.com/documize/community/model/user"
|
||||
casv2 "gopkg.in/cas.v2"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Handler contains the runtime information such as logging and database.
|
||||
|
@ -28,7 +29,6 @@ type Handler struct {
|
|||
Store *store.Store
|
||||
}
|
||||
|
||||
|
||||
// Authenticate checks CAS authentication credentials.
|
||||
func (h *Handler) Authenticate(w http.ResponseWriter, r *http.Request) {
|
||||
method := "authenticate"
|
||||
|
@ -63,15 +63,15 @@ func (h *Handler) Authenticate(w http.ResponseWriter, r *http.Request) {
|
|||
ac := ath.CASConfig{}
|
||||
err = json.Unmarshal([]byte(org.AuthConfig), &ac)
|
||||
if err != nil {
|
||||
response.WriteBadRequestError(w, method, "Unable to unmarshall Keycloak Public Key")
|
||||
response.WriteBadRequestError(w, method, "Unable to unmarshal CAS configuration")
|
||||
h.Runtime.Log.Error(method, err)
|
||||
return
|
||||
}
|
||||
service := url.QueryEscape(ac.RedirectURL)
|
||||
|
||||
validateUrl := ac.URL + "/serviceValidate?ticket=" + a.Ticket + "&service="+ service;
|
||||
validateURL := ac.URL + "/serviceValidate?ticket=" + a.Ticket + "&service=" + service
|
||||
|
||||
resp, err := http.Get(validateUrl)
|
||||
resp, err := http.Get(validateURL)
|
||||
if err != nil {
|
||||
response.WriteBadRequestError(w, method, "Unable to get service validate url")
|
||||
h.Runtime.Log.Error(method, err)
|
||||
|
|
|
@ -10,10 +10,8 @@
|
|||
// https://documize.com
|
||||
|
||||
import { isPresent } from '@ember/utils';
|
||||
|
||||
import { reject, resolve } from 'rsvp';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
import Base from 'ember-simple-auth/authenticators/base';
|
||||
import netUtil from "../utils/net";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{layout/logo-heading
|
||||
title="Authentication"
|
||||
desc="Choose user authentication provider — Documize, Redhat Keycloak, LDAP/AD, CAS"
|
||||
desc="Choose user authentication provider — Documize, Redhat Keycloak, LDAP/AD, Central Authentication Server"
|
||||
icon=constants.Icon.Locked}}
|
||||
|
||||
{{customize/auth-settings
|
||||
|
|
|
@ -18,14 +18,14 @@
|
|||
</li>
|
||||
<li class="option {{if isLDAPProvider "selected"}}" {{action "onLDAP"}}>
|
||||
<div class="text-header">LDAP</div>
|
||||
<div class="text">Connect to LDAP/ Active Directory</div>
|
||||
<div class="text">Connect to LDAP/Active Directory</div>
|
||||
{{#if isLDAPProvider}}
|
||||
<i class="dicon {{constants.Icon.Tick}}" />
|
||||
{{/if}}
|
||||
</li>
|
||||
<li class="option {{if isCASProvider "selected"}}" {{action "onCAS"}}>
|
||||
<div class="text-header">CAS</div>
|
||||
<div class="text">Via authentication server</div>
|
||||
<div class="text">Via Central Authentication Server</div>
|
||||
{{#if isCASProvider}}
|
||||
<i class="dicon {{constants.Icon.Tick}}" />
|
||||
{{/if}}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package auth
|
||||
|
||||
|
||||
// CASAuthRequest data received via Keycloak client library
|
||||
// CASAuthRequest data received via CAS client library
|
||||
type CASAuthRequest struct {
|
||||
Ticket string `json:"ticket"`
|
||||
Ticket string `json:"ticket"`
|
||||
Domain string `json:"domain"`
|
||||
}
|
||||
|
||||
|
||||
// CASConfig server configuration
|
||||
type CASConfig struct {
|
||||
URL string `json:"url"`
|
||||
URL string `json:"url"`
|
||||
RedirectURL string `json"redirectUrl"`
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue