mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
server: prune unused constants and functions (#477)
This removes unused `const` variables and functions from `server` and its subpackages.
This commit is contained in:
parent
595bf9acac
commit
9b902428ea
6 changed files with 0 additions and 28 deletions
|
|
@ -275,10 +275,6 @@ func (d *Datastore) Close() error {
|
|||
return d.db.Close()
|
||||
}
|
||||
|
||||
func (d *Datastore) log(msg string) {
|
||||
d.logger.Log("comp", d.Name(), "msg", msg)
|
||||
}
|
||||
|
||||
func sanitizeColumn(col string) string {
|
||||
return columnCharsRegexp.ReplaceAllString(col, "")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ func TestValidatePassword(t *testing.T) {
|
|||
{"jason", "bar0baz!?", "jason@kolide.co", true, false},
|
||||
}
|
||||
|
||||
const bcryptCost = 6
|
||||
|
||||
for _, tt := range passwordTests {
|
||||
user := newTestUser(t, tt.Username, tt.Password, tt.Email)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
const bcryptCost = 6
|
||||
|
||||
func TestAuthenticate(t *testing.T) {
|
||||
ds, err := inmem.New(config.TestConfig())
|
||||
require.Nil(t, err)
|
||||
|
|
|
|||
|
|
@ -106,13 +106,6 @@ func (r resp) rawResponse() string {
|
|||
return r.rawResp
|
||||
}
|
||||
|
||||
func (r resp) authResponse() (*Response, error) {
|
||||
if r.response != nil {
|
||||
return r.response, nil
|
||||
}
|
||||
return nil, errors.New("missing SAML response")
|
||||
}
|
||||
|
||||
// DecodeAuthResponse extracts SAML assertions from IDP response
|
||||
func DecodeAuthResponse(samlResponse string) (kolide.Auth, error) {
|
||||
var authInfo resp
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ type AuthnRequest struct {
|
|||
NameIDPolicy *NameIDPolicy `xml:"NameIDPolicy,omitempty"`
|
||||
RequestedAuthnContext *RequestedAuthnContext `xml:"RequestedAuthnContext,omitempty"`
|
||||
Signature *Signature `xml:"Signature,omitempty"`
|
||||
originalString string
|
||||
}
|
||||
|
||||
// Response is submitted to the service provider (Kolide) from the IDP via a callback.
|
||||
|
|
@ -43,8 +42,6 @@ type Response struct {
|
|||
Signature Signature `xml:"Signature"`
|
||||
Issuer Issuer `xml:"Issuer"`
|
||||
Status Status `xml:"Status"`
|
||||
|
||||
originalString string
|
||||
}
|
||||
|
||||
type Issuer struct {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ package websocket
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/igm/sockjs-go/v3/sockjs"
|
||||
|
||||
|
|
@ -13,20 +12,11 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// maxMessageSize is used to set a read limit on the websocket and
|
||||
// prevent clients from flooding us with data.
|
||||
maxMessageSize int64 = 8096
|
||||
|
||||
// authType is the type string used for auth messages.
|
||||
authType string = "auth"
|
||||
|
||||
// errType is the type string used for error messages.
|
||||
errType string = "error"
|
||||
|
||||
// defaultTimeout is the default timeout that should be used for
|
||||
// sending and receiving over the websocket. It is used unless
|
||||
// Conn.Timeout is set explicitly after Upgrade is called.
|
||||
defaultTimeout time.Duration = 3 * time.Second
|
||||
)
|
||||
|
||||
// JSONMessage is a wrapper struct for messages that will be sent across the wire
|
||||
|
|
|
|||
Loading…
Reference in a new issue