Documentation ¶
Index ¶
- Constants
- Variables
- func AddGroup(c *gin.Context)
- func AddKey(c *gin.Context)
- func AddRoutes(r *gin.Engine) *gin.Engine
- func AddUser(c *gin.Context)
- func CheckApiKey() gin.HandlerFunc
- func CreateHome(c *gin.Context)
- func DefaultGetClient(c *gin.Context) *sshkeymanager.Client
- func DeleteGroup(c *gin.Context)
- func DeleteKey(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func FindGroup(c *gin.Context)
- func FindKey(c *gin.Context)
- func FindUser(c *gin.Context)
- func GetClient(c *gin.Context) *sshkeymanager.Client
- func GetGroups(c *gin.Context)
- func GetKeys(c *gin.Context)
- func GetUsers(c *gin.Context)
- func RequestLoggerMiddleware() gin.HandlerFunc
- func SetClient(GetClient func(*gin.Context) *sshkeymanager.Client) gin.HandlerFunc
- func WriteKeys(c *gin.Context)
- type BasicError
- type BasicRequest
- type BasicResponse
- type EmptyRequest
- type EmptyResponse
- type GroupRequest
- type GroupResponse
- type GroupsResponse
- type KeyRequest
- type KeyResponse
- type KeysRequest
- type KeysResponse
- type KmError
- type UserRequest
- type UserResponse
- type UsersResponse
Constants ¶
View Source
const CONTEXT_KEY = "ssh-key-manager-client"
View Source
const MIN_LENGTH = 10
View Source
const MIN_STRENGTH = 3
Variables ¶
View Source
var API_KEY string
Functions ¶
func CheckApiKey ¶
func CheckApiKey() gin.HandlerFunc
func CreateHome ¶
func DefaultGetClient ¶
func DefaultGetClient(c *gin.Context) *sshkeymanager.Client
DefaultGetClient is designed to be overriden for custom API server settings
func DeleteGroup ¶
func DeleteUser ¶
func RequestLoggerMiddleware ¶
func RequestLoggerMiddleware() gin.HandlerFunc
func SetClient ¶
func SetClient(GetClient func(*gin.Context) *sshkeymanager.Client) gin.HandlerFunc
Types ¶
type BasicError ¶
type BasicError struct {
Err *string `json:"error"`
}
type BasicRequest ¶
type BasicRequest struct { }
type BasicResponse ¶
type BasicResponse struct {
Err *KmError `json:"error"`
}
type EmptyRequest ¶
type EmptyRequest struct{}
type EmptyResponse ¶
type EmptyResponse struct{}
type GroupRequest ¶
type GroupResponse ¶
type GroupsResponse ¶
type KeyRequest ¶
type KeyRequest struct { User passwd.User `json:"user"` Key *authorized_keys.SSHKey `json:"key"` Err *KmError `json:"error"` }
type KeyResponse ¶
type KeyResponse struct { User *passwd.User `json:"user"` Key *authorized_keys.SSHKey `json:"key"` Err *KmError `json:"error"` }
type KeysRequest ¶
type KeysRequest struct { User passwd.User `json:"user"` Keys []authorized_keys.SSHKey `json:"keys"` Err *KmError `json:"error"` }
type KeysResponse ¶
type KeysResponse struct { User *passwd.User `json:"user"` Keys []authorized_keys.SSHKey `json:"keys"` Err *KmError `json:"error"` }
type KmError ¶
type KmError struct {
// contains filtered or unexported fields
}
JSON marshaling of errors See: http://blog.magmalabs.io/2014/11/13/custom-error-marshaling-to-json-in-go.html
func MakeKmError ¶
func (*KmError) MarshalJSON ¶
type UserRequest ¶
type UserResponse ¶
type UsersResponse ¶
Click to show internal directories.
Click to hide internal directories.