Documentation ¶
Index ¶
- Constants
- type ClientConfig
- type EnsureHasPermission
- type EnsureHasPermissionOptions
- type EnsureIsAuthorized
- type EnsureIsAuthorizedOptions
- type Error
- type GetObjectIdFunc
- type GetUserIdFunc
- type ListParams
- type ListPermissionParams
- type ListRoleParams
- type ListTenantParams
- type ListUserParams
- type ListWarrantParams
- type Middleware
- type MiddlewareConfig
- type NewEnsureHasPermissionFunc
- type NewEnsureIsAuthorizedFunc
- type Permission
- type PermissionCheckParams
- type QueryWarrantParams
- type Role
- type Session
- type Subject
- type Tenant
- type User
- type Warrant
- type WarrantCheckParams
- type WarrantCheckResult
- type WarrantClient
- func (client WarrantClient) AssignPermissionToRole(roleId string, permissionId string) (*Permission, error)
- func (client WarrantClient) AssignPermissionToUser(userId string, permissionId string) (*Permission, error)
- func (client WarrantClient) AssignRoleToUser(userId string, roleId string) (*Role, error)
- func (client WarrantClient) AssignUserToTenant(tenantId string, userId string) (*Warrant, error)
- func (client WarrantClient) CreateAuthorizationSession(session Session) (string, error)
- func (client WarrantClient) CreatePermission(permission Permission) (*Permission, error)
- func (client WarrantClient) CreateRole(role Role) (*Role, error)
- func (client WarrantClient) CreateSelfServiceSession(session Session, redirectUrl string) (string, error)
- func (client WarrantClient) CreateTenant(tenant Tenant) (*Tenant, error)
- func (client WarrantClient) CreateUser(user User) (*User, error)
- func (client WarrantClient) CreateWarrant(warrantToCreate Warrant) (*Warrant, error)
- func (client WarrantClient) DeletePermission(permissionId string) error
- func (client WarrantClient) DeleteRole(roleId string) error
- func (client WarrantClient) DeleteTenant(tenantId string) error
- func (client WarrantClient) DeleteUser(userId string) error
- func (client WarrantClient) DeleteWarrant(warrantToDelete Warrant) error
- func (client WarrantClient) GetPermission(permissionId string) (*Permission, error)
- func (client WarrantClient) GetRole(roleId string) (*Role, error)
- func (client WarrantClient) GetTenant(tenantId string) (*Tenant, error)
- func (client WarrantClient) GetUser(userId string) (*User, error)
- func (client WarrantClient) HasPermission(toCheck PermissionCheckParams) (bool, error)
- func (client WarrantClient) IsAuthorized(toCheck WarrantCheckParams) (bool, error)
- func (client WarrantClient) ListPermissions(listParams ListPermissionParams) ([]Permission, error)
- func (client WarrantClient) ListPermissionsForRole(roleId string, listParams ListPermissionParams) ([]Permission, error)
- func (client WarrantClient) ListPermissionsForUser(userId string, listParams ListPermissionParams) ([]Permission, error)
- func (client WarrantClient) ListRoles(listParams ListRoleParams) ([]Role, error)
- func (client WarrantClient) ListRolesForUser(userId string, listParams ListRoleParams) ([]Role, error)
- func (client WarrantClient) ListTenants(listParams ListTenantParams) ([]Tenant, error)
- func (client WarrantClient) ListTenantsForUser(userId string, listParams ListTenantParams) ([]Tenant, error)
- func (client WarrantClient) ListUsers(listParams ListUserParams) ([]User, error)
- func (client WarrantClient) ListUsersForTenant(tenantId string) ([]User, error)
- func (client WarrantClient) ListWarrants(listParams ListWarrantParams) ([]Warrant, error)
- func (client WarrantClient) QueryWarrants(queryWarrantParams QueryWarrantParams) ([]Warrant, error)
- func (client WarrantClient) RemovePermissionFromRole(roleId string, permissionId string) error
- func (client WarrantClient) RemovePermissionFromUser(userId string, permissionId string) error
- func (client WarrantClient) RemoveRoleFromUser(userId string, roleId string) error
- func (client WarrantClient) RemoveUserFromTenant(tenantId string, userId string) error
- func (client WarrantClient) UpdateTenant(tenantId string, tenant Tenant) (*Tenant, error)
- func (client WarrantClient) UpdateUser(userId string, user User) (*User, error)
Constants ¶
View Source
const API_URL_BASE = "https://api.warrant.dev"
View Source
const API_VERSION = "/v1"
View Source
const SELF_SERVICE_DASH_URL_BASE = "https://self-serve.warrant.dev"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type EnsureHasPermission ¶ added in v1.0.1
type EnsureHasPermission struct {
// contains filtered or unexported fields
}
func (*EnsureHasPermission) ServeHTTP ¶ added in v1.0.1
func (ehp *EnsureHasPermission) ServeHTTP(w http.ResponseWriter, r *http.Request)
type EnsureHasPermissionOptions ¶ added in v1.0.1
type EnsureIsAuthorized ¶ added in v1.0.1
type EnsureIsAuthorized struct {
// contains filtered or unexported fields
}
func (*EnsureIsAuthorized) ServeHTTP ¶ added in v1.0.1
func (eia *EnsureIsAuthorized) ServeHTTP(w http.ResponseWriter, r *http.Request)
type EnsureIsAuthorizedOptions ¶ added in v1.0.1
type GetObjectIdFunc ¶ added in v1.0.1
type GetUserIdFunc ¶ added in v1.0.1
type ListParams ¶ added in v1.2.0
type ListPermissionParams ¶ added in v1.2.0
type ListPermissionParams struct {
ListParams
}
type ListRoleParams ¶ added in v1.2.0
type ListRoleParams struct {
ListParams
}
type ListTenantParams ¶ added in v1.2.0
type ListTenantParams struct {
ListParams
}
type ListUserParams ¶ added in v1.2.0
type ListUserParams struct {
ListParams
}
type ListWarrantParams ¶ added in v1.2.0
type ListWarrantParams struct { ListParams ObjectType string `json:"objectType" url:"objectType,omitempty"` ObjectId string `json:"objectId" url:"objectId,omitempty"` Relation string `json:"relation" url:"relation,omitempty"` UserId string `json:"userId" url:"userId,omitempty"` }
type Middleware ¶ added in v1.0.1
type Middleware struct {
// contains filtered or unexported fields
}
func NewMiddleware ¶ added in v1.0.1
func NewMiddleware(config MiddlewareConfig) *Middleware
func (Middleware) NewEnsureHasPermission ¶ added in v1.0.1
func (mw Middleware) NewEnsureHasPermission(handler http.Handler, options EnsureHasPermissionOptions) *EnsureHasPermission
func (Middleware) NewEnsureIsAuthorized ¶ added in v1.0.1
func (mw Middleware) NewEnsureIsAuthorized(handler http.Handler, options EnsureIsAuthorizedOptions) *EnsureIsAuthorized
type MiddlewareConfig ¶ added in v1.0.1
type MiddlewareConfig struct { ApiKey string GetObjectId GetObjectIdFunc GetUserId GetUserIdFunc OnAccessDenied http.HandlerFunc }
type NewEnsureHasPermissionFunc ¶ added in v1.0.1
type NewEnsureHasPermissionFunc func(handler http.Handler, options EnsureHasPermissionOptions) *EnsureHasPermission
type NewEnsureIsAuthorizedFunc ¶ added in v1.0.1
type NewEnsureIsAuthorizedFunc func(handler http.Handler, options EnsureIsAuthorizedOptions) *EnsureIsAuthorized
type Permission ¶
type Permission struct {
PermissionId string `json:"permissionId"`
}
type PermissionCheckParams ¶ added in v1.1.0
type QueryWarrantParams ¶ added in v1.3.0
type Subject ¶ added in v1.1.0
type WarrantCheckParams ¶ added in v1.1.0
type WarrantCheckResult ¶ added in v1.1.0
type WarrantClient ¶
type WarrantClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(config ClientConfig) WarrantClient
func (WarrantClient) AssignPermissionToRole ¶
func (client WarrantClient) AssignPermissionToRole(roleId string, permissionId string) (*Permission, error)
func (WarrantClient) AssignPermissionToUser ¶
func (client WarrantClient) AssignPermissionToUser(userId string, permissionId string) (*Permission, error)
func (WarrantClient) AssignRoleToUser ¶
func (client WarrantClient) AssignRoleToUser(userId string, roleId string) (*Role, error)
func (WarrantClient) AssignUserToTenant ¶
func (client WarrantClient) AssignUserToTenant(tenantId string, userId string) (*Warrant, error)
func (WarrantClient) CreateAuthorizationSession ¶
func (client WarrantClient) CreateAuthorizationSession(session Session) (string, error)
func (WarrantClient) CreatePermission ¶
func (client WarrantClient) CreatePermission(permission Permission) (*Permission, error)
func (WarrantClient) CreateRole ¶
func (client WarrantClient) CreateRole(role Role) (*Role, error)
func (WarrantClient) CreateSelfServiceSession ¶
func (client WarrantClient) CreateSelfServiceSession(session Session, redirectUrl string) (string, error)
func (WarrantClient) CreateTenant ¶
func (client WarrantClient) CreateTenant(tenant Tenant) (*Tenant, error)
func (WarrantClient) CreateUser ¶
func (client WarrantClient) CreateUser(user User) (*User, error)
func (WarrantClient) CreateWarrant ¶
func (client WarrantClient) CreateWarrant(warrantToCreate Warrant) (*Warrant, error)
func (WarrantClient) DeletePermission ¶
func (client WarrantClient) DeletePermission(permissionId string) error
func (WarrantClient) DeleteRole ¶
func (client WarrantClient) DeleteRole(roleId string) error
func (WarrantClient) DeleteTenant ¶ added in v1.0.2
func (client WarrantClient) DeleteTenant(tenantId string) error
func (WarrantClient) DeleteUser ¶ added in v1.0.2
func (client WarrantClient) DeleteUser(userId string) error
func (WarrantClient) DeleteWarrant ¶ added in v1.1.0
func (client WarrantClient) DeleteWarrant(warrantToDelete Warrant) error
func (WarrantClient) GetPermission ¶ added in v1.1.0
func (client WarrantClient) GetPermission(permissionId string) (*Permission, error)
func (WarrantClient) GetRole ¶ added in v1.1.0
func (client WarrantClient) GetRole(roleId string) (*Role, error)
func (WarrantClient) GetTenant ¶ added in v1.1.0
func (client WarrantClient) GetTenant(tenantId string) (*Tenant, error)
func (WarrantClient) GetUser ¶ added in v1.1.0
func (client WarrantClient) GetUser(userId string) (*User, error)
func (WarrantClient) HasPermission ¶
func (client WarrantClient) HasPermission(toCheck PermissionCheckParams) (bool, error)
func (WarrantClient) IsAuthorized ¶
func (client WarrantClient) IsAuthorized(toCheck WarrantCheckParams) (bool, error)
func (WarrantClient) ListPermissions ¶ added in v1.1.0
func (client WarrantClient) ListPermissions(listParams ListPermissionParams) ([]Permission, error)
func (WarrantClient) ListPermissionsForRole ¶ added in v1.2.0
func (client WarrantClient) ListPermissionsForRole(roleId string, listParams ListPermissionParams) ([]Permission, error)
func (WarrantClient) ListPermissionsForUser ¶ added in v1.2.0
func (client WarrantClient) ListPermissionsForUser(userId string, listParams ListPermissionParams) ([]Permission, error)
func (WarrantClient) ListRoles ¶ added in v1.1.0
func (client WarrantClient) ListRoles(listParams ListRoleParams) ([]Role, error)
func (WarrantClient) ListRolesForUser ¶ added in v1.2.0
func (client WarrantClient) ListRolesForUser(userId string, listParams ListRoleParams) ([]Role, error)
func (WarrantClient) ListTenants ¶ added in v1.1.0
func (client WarrantClient) ListTenants(listParams ListTenantParams) ([]Tenant, error)
func (WarrantClient) ListTenantsForUser ¶ added in v1.2.0
func (client WarrantClient) ListTenantsForUser(userId string, listParams ListTenantParams) ([]Tenant, error)
func (WarrantClient) ListUsers ¶ added in v1.1.0
func (client WarrantClient) ListUsers(listParams ListUserParams) ([]User, error)
func (WarrantClient) ListUsersForTenant ¶ added in v1.2.0
func (client WarrantClient) ListUsersForTenant(tenantId string) ([]User, error)
func (WarrantClient) ListWarrants ¶ added in v1.0.3
func (client WarrantClient) ListWarrants(listParams ListWarrantParams) ([]Warrant, error)
func (WarrantClient) QueryWarrants ¶ added in v1.3.0
func (client WarrantClient) QueryWarrants(queryWarrantParams QueryWarrantParams) ([]Warrant, error)
func (WarrantClient) RemovePermissionFromRole ¶
func (client WarrantClient) RemovePermissionFromRole(roleId string, permissionId string) error
func (WarrantClient) RemovePermissionFromUser ¶
func (client WarrantClient) RemovePermissionFromUser(userId string, permissionId string) error
func (WarrantClient) RemoveRoleFromUser ¶
func (client WarrantClient) RemoveRoleFromUser(userId string, roleId string) error
func (WarrantClient) RemoveUserFromTenant ¶
func (client WarrantClient) RemoveUserFromTenant(tenantId string, userId string) error
func (WarrantClient) UpdateTenant ¶ added in v1.1.0
func (client WarrantClient) UpdateTenant(tenantId string, tenant Tenant) (*Tenant, error)
func (WarrantClient) UpdateUser ¶ added in v1.1.0
func (client WarrantClient) UpdateUser(userId string, user User) (*User, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.