Documentation
¶
Overview ¶
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- type BuiltResource
- type CreateDeploymentRequest
- type DBUser
- type DeployResourceRequest
- type FirstConfig
- type Project
- type ResourceKind
- type ResponseMessage
- type SailorCore
- func (sc *SailorCore) AuthBasicHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) AuthCallbackHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) AuthOIDCHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) AuthRBACHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) Authenticated(next fasthttp.RequestHandler, pnr v1.RBACConstraints) fasthttp.RequestHandler
- func (sc *SailorCore) ChangePasswordHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) ClientCallable(next fasthttp.RequestHandler) fasthttp.RequestHandler
- func (sc *SailorCore) CreateDeploymentHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) CreateProjectHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) CreateResourceHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) CreateUserHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) DeployResourceHandler(ctx *fasthttp.RequestCtx)
- func (c *SailorCore) GetAuditEvents(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) GetDeploymentHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) GetKeyPairHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) GetManifestHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) GetResourceHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) GetResourceSchemaHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) GetResourceSetting(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) GetSailorSettingHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) GetTokenHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) GetUserHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) K8sAdmissionHookHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) SailorSettingHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) UpdateManifestHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) UpdateResourceSchemaHandler(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) UpdateResourceSetting(ctx *fasthttp.RequestCtx)
- func (sc *SailorCore) VersionHandler(w http.ResponseWriter, r *http.Request)
- type SailorParams
- type User
Constants ¶
const ( // -- ADMIN -- BUCKET_ADMIN = "_admin" // BUCKET_PROJECTS will have list of all projects inside a // sailor instance, this bucket lives inside [BUCKET_ADMIN] BUCKET_PROJECTS = "projects" // BUCKET_USERS is used to store all the users and their // roles and permissions, this bucket lives inside [BUCKET_ADMIN] BUCKET_USERS = "users" // BUCKET_SETTING is collection of sailor wide settings this // buckect lives inside [BUCKET_ADMIN] BUCKET_SETTING = "settings" // KEY_SETTING is used to save sailor wide settings this // key lives inside [BUCKET_ADMIN] KEY_SETTING = "settings" // -- PROJECT -- // BUCKET_META contains meta information about a project. // Each project will have a meta bucket and it will contain: // // 1. access key // 2. secret key // 3. current deployed version of all resources BUCKET_META = "_meta" // KEY_ACCESS_KEY has the access key for a sailor project // this key lives inside [BUCKET_META] KEY_ACCESS_KEY = "access_key" // KEY_SECRET_KEY has the secret key for a sailor project // which is mainly used to encrypt and decrypt a secret // resource KEY_SECRET_KEY = "secret_key" // BUCKET_RESOURCE contains all the resources present in a project BUCKET_RESOURCE = "resource" // BUCKET_DEPLOYMENT contains buckets for each resource // - config // - secret // - {key}-misc // and each sub-bucket will contain list of deployments per resource BUCKET_DEPLOYMENT = "deployments" // --- AUDIT --- // BUCKET_AUDIT contains audit trail of each action taken // by an user BUCKET_AUDIT = "_audit" // BUCKET_AUDIT_TRAIL is a bucket inside the AUDIT sail BUCKET_AUDIT_TRAIL = "audit_trail" BUCKET_BACKUP = "backup" KEY_S3 = "s3" // db extension used by sailor DB_EXT = ".sail" // decoded sailor claims from request SAILOR_CLAIMS_KEY = "__sailor_claims" )
const ( KindConfig = "config" KindSecret = "secret" KindMisc = "misc" )
-- RESOURCE TYPES INSIDE SAILOR --
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuiltResource ¶ added in v0.0.4
type CreateDeploymentRequest ¶
type DBUser ¶
type DBUser struct {
Email string `json:"email"`
Username string `json:"username"`
Password [32]byte `json:"password"`
Permissions []string `json:"permissions"`
Roles []string `json:"roles"`
AllowedApps []string `json:"allowed_apps"`
Token string `json:"token"`
Fingerprint string `json:"fp"`
}
DBUser is the user object stored in the database
type DeployResourceRequest ¶
type DeployResourceRequest struct {
Version string `json:"version"`
}
type FirstConfig ¶
type FirstConfig struct {
App string `json:"app"`
}
type ResourceKind ¶
type ResourceKind string
func (ResourceKind) IsConfig ¶
func (rk ResourceKind) IsConfig() bool
func (ResourceKind) IsMisc ¶
func (rk ResourceKind) IsMisc() bool
func (ResourceKind) IsOneOf ¶
func (rk ResourceKind) IsOneOf(kinds ...ResourceKind) bool
func (ResourceKind) IsSecret ¶
func (rk ResourceKind) IsSecret() bool
func (ResourceKind) ResourceKey ¶
func (rk ResourceKind) ResourceKey(name string) string
type ResponseMessage ¶
type ResponseMessage struct {
Message string `json:"message"`
}
type SailorCore ¶
type SailorCore struct {
Log *zap.Logger
// TODO :: we need to abstract all sail operations behind this
// single interface
SailorSail sail.Sail
// contains filtered or unexported fields
}
func NewSailorCore ¶
func NewSailorCore() *SailorCore
func (*SailorCore) AuthBasicHandler ¶
func (sc *SailorCore) AuthBasicHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) AuthCallbackHandler ¶
func (sc *SailorCore) AuthCallbackHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) AuthOIDCHandler ¶
func (sc *SailorCore) AuthOIDCHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) AuthRBACHandler ¶
func (sc *SailorCore) AuthRBACHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) Authenticated ¶
func (sc *SailorCore) Authenticated(next fasthttp.RequestHandler, pnr v1.RBACConstraints) fasthttp.RequestHandler
func (*SailorCore) ChangePasswordHandler ¶
func (sc *SailorCore) ChangePasswordHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) ClientCallable ¶
func (sc *SailorCore) ClientCallable(next fasthttp.RequestHandler) fasthttp.RequestHandler
func (*SailorCore) CreateDeploymentHandler ¶
func (sc *SailorCore) CreateDeploymentHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) CreateProjectHandler ¶
func (sc *SailorCore) CreateProjectHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) CreateResourceHandler ¶
func (sc *SailorCore) CreateResourceHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) CreateUserHandler ¶
func (sc *SailorCore) CreateUserHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) DeployResourceHandler ¶
func (sc *SailorCore) DeployResourceHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) GetAuditEvents ¶ added in v0.0.3
func (c *SailorCore) GetAuditEvents(ctx *fasthttp.RequestCtx)
func (*SailorCore) GetDeploymentHandler ¶
func (sc *SailorCore) GetDeploymentHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) GetKeyPairHandler ¶ added in v0.0.4
func (sc *SailorCore) GetKeyPairHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) GetManifestHandler ¶
func (sc *SailorCore) GetManifestHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) GetResourceHandler ¶
func (sc *SailorCore) GetResourceHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) GetResourceSchemaHandler ¶
func (sc *SailorCore) GetResourceSchemaHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) GetResourceSetting ¶
func (sc *SailorCore) GetResourceSetting(ctx *fasthttp.RequestCtx)
func (*SailorCore) GetSailorSettingHandler ¶
func (sc *SailorCore) GetSailorSettingHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) GetTokenHandler ¶
func (sc *SailorCore) GetTokenHandler(ctx *fasthttp.RequestCtx)
GetTokenHandler gives sailor specific token to the user, to interact with the resource APIs, the /token call happens after oidc callback
func (*SailorCore) GetUserHandler ¶
func (sc *SailorCore) GetUserHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) K8sAdmissionHookHandler ¶ added in v0.0.4
func (sc *SailorCore) K8sAdmissionHookHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) SailorSettingHandler ¶
func (sc *SailorCore) SailorSettingHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) UpdateManifestHandler ¶
func (sc *SailorCore) UpdateManifestHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) UpdateResourceSchemaHandler ¶
func (sc *SailorCore) UpdateResourceSchemaHandler(ctx *fasthttp.RequestCtx)
func (*SailorCore) UpdateResourceSetting ¶
func (sc *SailorCore) UpdateResourceSetting(ctx *fasthttp.RequestCtx)
func (*SailorCore) VersionHandler ¶
func (sc *SailorCore) VersionHandler(w http.ResponseWriter, r *http.Request)
VersionHandler ... TODO :: need to create version API for efficient pulls
type SailorParams ¶
Source Files
¶
- audit.go
- authback.go
- authbasic.go
- authoidc.go
- changepwd.go
- createdep.go
- createproj.go
- createres.go
- createuser.go
- deployres.go
- getdep.go
- getmanifest.go
- getres.go
- getressetting.go
- getschema.go
- getuser.go
- k8shook.go
- keypair.go
- middlewares.go
- rbac.go
- setting.go
- token.go
- types.go
- updatemanifest.go
- updateressetting.go
- updateschema.go
- version.go