Documentation ¶
Overview ¶
Copyright (C) 2023 Tim Bastin, l3montree UG (haftungsbeschränkt)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func AccessControlMiddleware(obj accesscontrol.Object, act accesscontrol.Action) echo.MiddlewareFunc
- func GetAsset(c Context) models.Asset
- func GetAssetSlug(c Context) (string, error)
- func GetAuthAdminClient(c Context) *client.APIClient
- func GetFlawID(c Context) (string, error)
- func GetOrgSlug(c Context) (string, error)
- func GetOryClient(c Context) *client.APIClient
- func GetParam(c Context, param string) string
- func GetProject(c Context) models.Project
- func GetProjectSlug(c Context) (string, error)
- func GetRBAC(c Context) accesscontrol.AccessControl
- func GetTenant(c Context) models.Org
- func InitLogger()
- func LoadConfig() error
- func Ptr[T any](t T) *T
- func SanitizeParam(s string) string
- func SetAuthAdminClient(c Context, i *client.APIClient)
- func SetThirdPartyIntegration(c Context, i ThirdPartyIntegration)
- type AuthSession
- type Context
- type DB
- type Environmental
- type FilterQuery
- type FlawEvent
- type ManualMitigateEvent
- type MiddlewareFunc
- type PageInfo
- type Paged
- type Repository
- type Server
- type SortQuery
- type ThirdPartyIntegration
- type User
Constants ¶
This section is empty.
Variables ¶
var V = validator.New()
Functions ¶
func AccessControlMiddleware ¶
func AccessControlMiddleware(obj accesscontrol.Object, act accesscontrol.Action) echo.MiddlewareFunc
func GetAssetSlug ¶
func GetAuthAdminClient ¶ added in v0.4.19
func GetAuthAdminClient(c Context) *client.APIClient
func GetOrgSlug ¶ added in v0.5.1
func GetOryClient ¶
func GetOryClient(c Context) *client.APIClient
func GetProject ¶
func GetProjectSlug ¶
func GetRBAC ¶
func GetRBAC(c Context) accesscontrol.AccessControl
func InitLogger ¶
func InitLogger()
InitLogger initializes the logger with a tint handler. tint is a simple logging library that allows to add colors to the log output. this is obviously not required, but it makes the logs easier to read.
func LoadConfig ¶
func LoadConfig() error
func SanitizeParam ¶
func SetAuthAdminClient ¶ added in v0.4.19
func SetAuthAdminClient(c Context, i *client.APIClient)
func SetThirdPartyIntegration ¶ added in v0.4.19
func SetThirdPartyIntegration(c Context, i ThirdPartyIntegration)
Types ¶
type AuthSession ¶
type AuthSession interface {
GetUserID() string
}
func GetSession ¶
func GetSession(ctx Context) AuthSession
type Environmental ¶
type Environmental struct { ConfidentialityRequirements string IntegrityRequirements string AvailabilityRequirements string }
func GetEnvironmental ¶
func GetEnvironmental(ctx Context) Environmental
func GetEnvironmentalFromAsset ¶
func GetEnvironmentalFromAsset(m models.Asset) Environmental
func SanitizeEnv ¶
func SanitizeEnv(env Environmental) Environmental
type FilterQuery ¶
type FilterQuery struct {
// contains filtered or unexported fields
}
func GetFilterQuery ¶
func GetFilterQuery(ctx Context) []FilterQuery
func (FilterQuery) SQL ¶
func (f FilterQuery) SQL() string
func (FilterQuery) Value ¶
func (f FilterQuery) Value() any
type ManualMitigateEvent ¶ added in v0.5.1
type ManualMitigateEvent struct {
Ctx Context
}
type MiddlewareFunc ¶
type MiddlewareFunc = echo.MiddlewareFunc
type PageInfo ¶
func GetPageInfo ¶
type Repository ¶ added in v0.4.19
type SortQuery ¶
func GetSortQuery ¶
type ThirdPartyIntegration ¶ added in v0.4.19
type ThirdPartyIntegration interface { IntegrationEnabled(ctx Context) bool WantsToHandleWebhook(ctx Context) bool HandleWebhook(ctx Context) error WantsToFinishInstallation(ctx Context) bool FinishInstallation(ctx Context) error ListRepositories(ctx Context) ([]Repository, error) HandleEvent(event any) error GetUsers(org models.Org) []User }
func GetThirdPartyIntegration ¶ added in v0.4.19
func GetThirdPartyIntegration(c Context) ThirdPartyIntegration