GithubHelp home page GithubHelp logo

kauth's Introduction

KAuth

Execute actions as privileged user

Introduction

KAuth provides a convenient, system-integrated way to offload actions that need to be performed as a privileged user (root, for example) to small (hopefully secure) helper utilities.

Usage

If you are using CMake, you need to have

find_package(KF6Auth NO_MODULE)

(or find KF6 with the Auth component) in your CMakeLists.txt file. You need to link to KF6::AuthCore.

Executing privileged actions typically involves having a minimal helper utility that does the actual work, and calling that utility with escalated privileges if the user has permission to do so (often requiring the user to enter appropriate credentials, like entering a password).

Therefore, use of the KAuth library is in two parts. In the main part of your code, you use KAuth::Action (and specifically KAuth::Action::execute()) when you need to do something privileged, like write to a file normally only writable by root.

The code that actually performs that action, such as writing to a file, needs to be placed in the slot of a helper QObject class, which should use the methods of KAuth::HelperSupport and be compiled into an executable. You will also want to use the kauth_install_helper_files and kauth_install_actions macros in your CMakeLists.txt.

See https://develop.kde.org/docs/features/kauth/ for a detailed tutorial on how to use KAuth.

kauth's People

Contributors

dfaure avatar kossebau avatar montel avatar ahmadsamir avatar tsdgeos avatar nicolasfella avatar aleixpol avatar davidedmundson avatar krop avatar agateau avatar hsitter avatar vkrause avatar jriddell avatar heirecka avatar elvisangelaccio avatar randomguy3 avatar alex1701c avatar bcooksley avatar krf avatar arichardson avatar wengxt avatar wrobelda avatar yurchor avatar steveire avatar mgraesslin avatar nmariusp avatar tosky avatar er-vin avatar jpwhiting avatar heliocastro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.