policykit1

package
v0.0.0-...-77ac5d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: GPL-3.0 Imports: 7 Imported by: 9

Documentation

Overview

SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.

SPDX-License-Identifier: GPL-3.0-or-later

SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.

SPDX-License-Identifier: GPL-3.0-or-later

Index

Constants

View Source
const (
	SubjectKindUnixProcess   = "unix-process"
	SubjectKindUnixSession   = "unix-session"
	SubjectKindSystemBusName = "system-bus-name"
)

SubjectKind

View Source
const (
	CheckAuthorizationFlagsNone                 = 0
	CheckAuthorizationFlagsAllowUserInteraction = 1
)

CheckAuthorizationFlags

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionDescription

type ActionDescription struct {
	ActionId         string
	Description      string
	Message          string
	VendorName       string
	VendorURL        string
	IconName         string
	ImplicitAny      ImplicitAuthorization
	ImplicitInactive ImplicitAuthorization
	ImplicitActive   ImplicitAuthorization
}

type Authority

type Authority interface {
	proxy.Object
	// contains filtered or unexported methods
}

func NewAuthority

func NewAuthority(conn *dbus.Conn) Authority

type AuthorizationResult

type AuthorizationResult struct {
	IsAuthorized bool
	IsChallenge  bool
	Details      map[string]dbus.Variant
}

type Identity

type Identity struct {
	Kind    string
	Details map[string]dbus.Variant
}

type ImplicitAuthorization

type ImplicitAuthorization uint32

type MockAuthority

type MockAuthority struct {
	MockInterfaceAuthority // interface org.freedesktop.PolicyKit1.Authority
	proxy.MockObject
}

type MockInterfaceAuthority

type MockInterfaceAuthority struct {
	mock.Mock
}

func (*MockInterfaceAuthority) AuthenticationAgentResponse

func (v *MockInterfaceAuthority) AuthenticationAgentResponse(flags dbus.Flags, cookie string, identity Identity) error

func (*MockInterfaceAuthority) AuthenticationAgentResponse2

func (v *MockInterfaceAuthority) AuthenticationAgentResponse2(flags dbus.Flags, uid uint32, cookie string, identity Identity) error

func (*MockInterfaceAuthority) BackendFeatures

func (v *MockInterfaceAuthority) BackendFeatures() proxy.PropUint32

func (*MockInterfaceAuthority) BackendName

func (v *MockInterfaceAuthority) BackendName() proxy.PropString

func (*MockInterfaceAuthority) BackendVersion

func (v *MockInterfaceAuthority) BackendVersion() proxy.PropString

func (*MockInterfaceAuthority) CancelCheckAuthorization

func (v *MockInterfaceAuthority) CancelCheckAuthorization(flags dbus.Flags, cancellation_id string) error

func (*MockInterfaceAuthority) CheckAuthorization

func (v *MockInterfaceAuthority) CheckAuthorization(flags dbus.Flags, subject Subject, action_id string, details map[string]string, flags0 uint32, cancellation_id string) (AuthorizationResult, error)

func (*MockInterfaceAuthority) ConnectChanged

func (v *MockInterfaceAuthority) ConnectChanged(cb func()) (dbusutil.SignalHandlerId, error)

func (*MockInterfaceAuthority) EnumerateActions

func (v *MockInterfaceAuthority) EnumerateActions(flags dbus.Flags, locale string) ([]ActionDescription, error)

func (*MockInterfaceAuthority) EnumerateTemporaryAuthorizations

func (v *MockInterfaceAuthority) EnumerateTemporaryAuthorizations(flags dbus.Flags, subject Subject) (TemporaryAuthorization, error)

func (*MockInterfaceAuthority) GoAuthenticationAgentResponse

func (v *MockInterfaceAuthority) GoAuthenticationAgentResponse(flags dbus.Flags, ch chan *dbus.Call, cookie string, identity Identity) *dbus.Call

func (*MockInterfaceAuthority) GoAuthenticationAgentResponse2

func (v *MockInterfaceAuthority) GoAuthenticationAgentResponse2(flags dbus.Flags, ch chan *dbus.Call, uid uint32, cookie string, identity Identity) *dbus.Call

func (*MockInterfaceAuthority) GoCancelCheckAuthorization

func (v *MockInterfaceAuthority) GoCancelCheckAuthorization(flags dbus.Flags, ch chan *dbus.Call, cancellation_id string) *dbus.Call

func (*MockInterfaceAuthority) GoCheckAuthorization

func (v *MockInterfaceAuthority) GoCheckAuthorization(flags dbus.Flags, ch chan *dbus.Call, subject Subject, action_id string, details map[string]string, flags0 uint32, cancellation_id string) *dbus.Call

func (*MockInterfaceAuthority) GoEnumerateActions

func (v *MockInterfaceAuthority) GoEnumerateActions(flags dbus.Flags, ch chan *dbus.Call, locale string) *dbus.Call

func (*MockInterfaceAuthority) GoEnumerateTemporaryAuthorizations

func (v *MockInterfaceAuthority) GoEnumerateTemporaryAuthorizations(flags dbus.Flags, ch chan *dbus.Call, subject Subject) *dbus.Call

func (*MockInterfaceAuthority) GoRegisterAuthenticationAgent

func (v *MockInterfaceAuthority) GoRegisterAuthenticationAgent(flags dbus.Flags, ch chan *dbus.Call, subject Subject, locale string, object_path string) *dbus.Call

func (*MockInterfaceAuthority) GoRegisterAuthenticationAgentWithOptions

func (v *MockInterfaceAuthority) GoRegisterAuthenticationAgentWithOptions(flags dbus.Flags, ch chan *dbus.Call, subject Subject, locale string, object_path string, options map[string]dbus.Variant) *dbus.Call

func (*MockInterfaceAuthority) GoRevokeTemporaryAuthorizationById

func (v *MockInterfaceAuthority) GoRevokeTemporaryAuthorizationById(flags dbus.Flags, ch chan *dbus.Call, id string) *dbus.Call

func (*MockInterfaceAuthority) GoRevokeTemporaryAuthorizations

func (v *MockInterfaceAuthority) GoRevokeTemporaryAuthorizations(flags dbus.Flags, ch chan *dbus.Call, subject Subject) *dbus.Call

func (*MockInterfaceAuthority) GoUnregisterAuthenticationAgent

func (v *MockInterfaceAuthority) GoUnregisterAuthenticationAgent(flags dbus.Flags, ch chan *dbus.Call, subject Subject, object_path string) *dbus.Call

func (*MockInterfaceAuthority) RegisterAuthenticationAgent

func (v *MockInterfaceAuthority) RegisterAuthenticationAgent(flags dbus.Flags, subject Subject, locale string, object_path string) error

func (*MockInterfaceAuthority) RegisterAuthenticationAgentWithOptions

func (v *MockInterfaceAuthority) RegisterAuthenticationAgentWithOptions(flags dbus.Flags, subject Subject, locale string, object_path string, options map[string]dbus.Variant) error

func (*MockInterfaceAuthority) RevokeTemporaryAuthorizationById

func (v *MockInterfaceAuthority) RevokeTemporaryAuthorizationById(flags dbus.Flags, id string) error

func (*MockInterfaceAuthority) RevokeTemporaryAuthorizations

func (v *MockInterfaceAuthority) RevokeTemporaryAuthorizations(flags dbus.Flags, subject Subject) error

func (*MockInterfaceAuthority) UnregisterAuthenticationAgent

func (v *MockInterfaceAuthority) UnregisterAuthenticationAgent(flags dbus.Flags, subject Subject, object_path string) error

type Subject

type Subject struct {
	Kind    string
	Details map[string]dbus.Variant
}

func MakeSubject

func MakeSubject(kind string) Subject

func (*Subject) SetDetail

func (s *Subject) SetDetail(key string, value interface{})

type TemporaryAuthorization

type TemporaryAuthorization struct {
	Id           string
	ActionId     string
	Subject      Subject
	TimeObtained uint64
	TimeExpires  uint64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL