From cc7207bc5174e21bbce3622a8081d44899f37085 Mon Sep 17 00:00:00 2001 From: Jussi Laako Date: Tue, 11 Mar 2014 15:22:31 +0200 Subject: [PATCH] Hack a Tizen-compilable version together from 2.1.0 upstream release Change-Id: I6ee651d0ea39cfdd4b54ac0d14f20a761c581987 --- .gitignore | 5 - ChangeLog | 98 + Makefile.am | 9 +- Makefile.in | 7 + build-aux/ar-lib | 15 +- build-aux/compile | 94 +- build-aux/config.guess | 144 +- build-aux/config.sub | 8 +- build-aux/depcomp | 125 +- build-aux/install-sh | 14 +- build-aux/ltmain.sh | 32 +- build-aux/missing | 99 +- build-aux/py-compile | 3 +- configure | 20 +- configure.ac | 2 +- dists/debian/changelog | 12 + dists/debian/rules | 3 + dists/rpm/libgsignon-glib-suse.spec | 5 +- dists/rpm/libgsignon-glib-tizen.changes | 3 + dists/rpm/libgsignon-glib-tizen.spec | 2 +- docs/reference/examples.xml | 29 +- docs/reference/html/SignonAuthService.html | 486 ++++ docs/reference/html/SignonAuthSession.html | 1163 ++++---- docs/reference/html/SignonIdentity.html | 1311 +++++++++ docs/reference/html/SignonIdentityInfo.html | 1319 +++++---- docs/reference/html/SignonSecurityContext.html | 868 +++--- docs/reference/html/annotation-glossary.html | 71 +- docs/reference/html/api-index-1-8.html | 29 +- docs/reference/html/api-index-deprecated.html | 29 +- docs/reference/html/api-index-full.html | 245 +- docs/reference/html/appendices.html | 22 +- docs/reference/html/credential-management.html | 28 +- docs/reference/html/gsso-examples.html | 63 +- docs/reference/html/gsso-intro.html | 32 +- docs/reference/html/home.png | Bin 578 -> 256 bytes docs/reference/html/index.html | 16 +- docs/reference/html/index.sgml | 203 +- docs/reference/html/left-insensitive.png | Bin 0 -> 395 bytes docs/reference/html/left.png | Bin 373 -> 262 bytes .../html/libgsignon-glib-SignonAuthService.html | 371 --- .../html/libgsignon-glib-SignonError.html | 394 +-- .../html/libgsignon-glib-SignonIdentity.html | 946 ------- docs/reference/html/libgsignon-glib-objects.html | 26 +- docs/reference/html/libgsignon-glib-overview.html | 22 +- docs/reference/html/libgsignon-glib.devhelp2 | 222 +- docs/reference/html/object-tree.html | 28 +- docs/reference/html/right-insensitive.png | Bin 0 -> 373 bytes docs/reference/html/right.png | Bin 380 -> 261 bytes docs/reference/html/style.css | 247 +- docs/reference/html/up-insensitive.png | Bin 0 -> 374 bytes docs/reference/html/up.png | Bin 291 -> 260 bytes docs/reference/libgsignon-glib-sections.txt | 6 + examples/gsso-example.c | 162 +- libgsignon-glib/Makefile.am | 113 +- libgsignon-glib/Makefile.in | 147 +- libgsignon-glib/signon-auth-session.c | 70 +- libgsignon-glib/signon-auth-session.h | 12 +- libgsignon-glib/signon-enum-types.c | 48 + libgsignon-glib/signon-errors-enum.c | 61 + libgsignon-glib/signon-errors-map.c | 43 + libgsignon-glib/signon-identity-info.c | 187 +- libgsignon-glib/signon-identity-info.h | 16 +- libgsignon-glib/signon-identity.c | 79 +- libgsignon-glib/signon-identity.h | 20 +- libgsignon-glib/signon-marshal.c | 88 + libgsignon-glib/signon-marshal.h | 20 + libgsignon-glib/signon-types.h | 3 + libgsignon-glib/signon-utils.c | 5 +- libgsignon-glib/signon-utils.h | 3 +- libgsignon-glib/sso-auth-service-gen.c | 2723 +++++++++++++++++++ libgsignon-glib/sso-auth-service-gen.h | 434 +++ libgsignon-glib/sso-auth-session-gen.c | 1591 +++++++++++ libgsignon-glib/sso-auth-session-gen.h | 250 ++ libgsignon-glib/sso-identity-gen.c | 2872 ++++++++++++++++++++ libgsignon-glib/sso-identity-gen.h | 449 +++ packaging/libgsignon-glib.changes | 15 +- packaging/libgsignon-glib.spec | 68 +- tests/check_signon.c | 56 +- 78 files changed, 14447 insertions(+), 3964 deletions(-) create mode 100644 docs/reference/html/SignonAuthService.html create mode 100644 docs/reference/html/SignonIdentity.html create mode 100644 docs/reference/html/left-insensitive.png delete mode 100644 docs/reference/html/libgsignon-glib-SignonAuthService.html delete mode 100644 docs/reference/html/libgsignon-glib-SignonIdentity.html create mode 100644 docs/reference/html/right-insensitive.png create mode 100644 docs/reference/html/up-insensitive.png create mode 100644 libgsignon-glib/signon-enum-types.c create mode 100644 libgsignon-glib/signon-errors-enum.c create mode 100644 libgsignon-glib/signon-errors-map.c create mode 100644 libgsignon-glib/signon-marshal.c create mode 100644 libgsignon-glib/signon-marshal.h create mode 100644 libgsignon-glib/sso-auth-service-gen.c create mode 100644 libgsignon-glib/sso-auth-service-gen.h create mode 100644 libgsignon-glib/sso-auth-session-gen.c create mode 100644 libgsignon-glib/sso-auth-session-gen.h create mode 100644 libgsignon-glib/sso-identity-gen.c create mode 100644 libgsignon-glib/sso-identity-gen.h mode change 120000 => 100644 packaging/libgsignon-glib.changes mode change 120000 => 100644 packaging/libgsignon-glib.spec diff --git a/.gitignore b/.gitignore index 89ffe52..193db2d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,11 +15,6 @@ config.* gtk-doc.make examples/gsso-example /INSTALL -/libgsignon-glib/signon-errors-map.c -/libgsignon-glib/signon-marshal.c -/libgsignon-glib/signon-marshal.h -/libgsignon-glib/sso-*-gen.* -/libgsignon-glib/sso-*-gen-doc-* libtool m4/gtk-doc.m4 m4/libtool.m4 diff --git a/ChangeLog b/ChangeLog index 0efed50..08702b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,101 @@ +2014-03-06 Jussi Laako + +Release 2.1.0 + +2014-03-06 Jussi Laako + +identity-info: copy-before-free + +2014-03-05 Jussi Laako + +Remove const from GLib containers, since GLib container APIs only deal with non-const containers + +2014-03-04 Alexander Kanavin + +tests: fix compiler warnings + +2014-03-04 Alexander Kanavin + +example: fix compiler warnings + +2014-03-04 Alexander Kanavin + +Remove some const-ness in parameters to avoid casts in clients + +2014-03-04 Aleksander Zdyb + +Add examples for managing identity's ACL + +Show how to: +* list identity's ACL +* add new security context to ACL +* remove security context from ACL + +New commandline arguments are: +* --add-context (takes context with --context) +* --remove-context (takes context with --context) + +Option --query-identities now shows ACL for each identity + +2014-03-03 Jussi Laako + +identity: fix a bug and use local copy of identity info when performing store + +2014-02-20 Alexander Kanavin + +When making a variant from identity info, only include non-null or non-empty fields + +2014-02-19 Alexander Kanavin + +Always set store_secret flag when creating identity from variant + +2014-02-17 Alexander Kanavin + +docs: fix GSignonPlugin's signal name + +2014-01-31 Jussi Laako + +auth-session: simplify and reduce amount of identical code + +2014-01-31 Jussi Laako + +packaging: update debian changelog + +2014-01-31 Alberto Mardegan + +AuthSession: bring back libsignon-glib -compatible constructor + +Reintroduce the constructor which takes an integer parameter, to +increase compatibility with libsignon-glib, and rename the existing +constructor to signon_auth_session_new_for_identity(). +Also, declare a couple of types in signon-types.h, so that the signature +of the signon_auth_session_new_for_identity() can now properly accept a +SignonIdentity * (same trick used in libaccounts-glib). + +2014-01-31 Alberto Mardegan + +Identity: add constructors compatible with libsignon-glib + +Restore the constructors to the original form, in order to reduce the +differences with libsignon-glib; add a "_with_context" tag to the +constructors which take the additional application context parameter. + +2013-12-20 Alexander Kanavin + +Add a lcov recipe to Makefile.am + +2013-12-09 Alexander Kanavin + +Tweaks to SignonAuthSession docs + +2013-12-05 Alexander Kanavin + +Update the example to use allowed realms + +2013-12-04 Jussi Laako + +debian: optional rule to build debug version + 2013-11-25 Imran Zaman Release 2.0.3 diff --git a/Makefile.am b/Makefile.am index 1df8c31..3ecdd94 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,4 +60,11 @@ update-online-doc: git commit -m "Updated documentation for $(PACKAGE) to version $(VERSION)" && \ git push ; \ popd > /dev/null && \ - rm -rf $(PACKAGE)-$(VERSION) \ No newline at end of file + rm -rf $(PACKAGE)-$(VERSION) + +lcov: check + @rm -rf lcov-report + @lcov -c --directory libgsignon-glib/ --output-file lcov.output + @genhtml lcov.output --output-directory lcov-report + @rm lcov.output + @echo "Coverage report is in file://$(abs_srcdir)/lcov-report/index.html" \ No newline at end of file diff --git a/Makefile.in b/Makefile.in index 88cf522..9ba69a8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -893,6 +893,13 @@ update-online-doc: popd > /dev/null && \ rm -rf $(PACKAGE)-$(VERSION) +lcov: check + @rm -rf lcov-report + @lcov -c --directory libgsignon-glib/ --output-file lcov.output + @genhtml lcov.output --output-directory lcov-report + @rm lcov.output + @echo "Coverage report is in file://$(abs_srcdir)/lcov-report/index.html" + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/build-aux/ar-lib b/build-aux/ar-lib index c0286a4..67f5f36 100755 --- a/build-aux/ar-lib +++ b/build-aux/ar-lib @@ -2,9 +2,9 @@ # Wrapper for Microsoft lib.exe me=ar-lib -scriptversion=2012-01-30.22; # UTC +scriptversion=2012-03-01.08; # UTC -# Copyright (C) 2010, 2012 Free Software Foundation, Inc. +# Copyright (C) 2010-2012 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify @@ -153,7 +153,9 @@ action=${action#-} delete= extract= list= +quick= replace= +index= create= while test -n "$action" @@ -162,7 +164,10 @@ do d*) delete=yes ;; x*) extract=yes ;; t*) list=yes ;; + q*) quick=yes ;; r*) replace=yes ;; + s*) index=yes ;; + S*) ;; # the index is always updated implicitly c*) create=yes ;; u*) ;; # TODO: don't ignore the update modifier v*) ;; # TODO: don't ignore the verbose modifier @@ -173,8 +178,8 @@ do action=${action#?} done -case $delete$extract$list$replace in - yes) +case $delete$extract$list$quick$replace,$index in + yes,* | ,yes) ;; yesyes*) func_error "more than one action specified" @@ -225,7 +230,7 @@ elif test -n "$extract"; then done fi -elif test -n "$replace"; then +elif test -n "$quick$replace"; then if test ! -f "$orig_archive"; then if test -z "$create"; then echo "$me: creating $orig_archive" diff --git a/build-aux/compile b/build-aux/compile index b1f4749..7b4a9a7 100755 --- a/build-aux/compile +++ b/build-aux/compile @@ -1,10 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-01-04.17; # UTC +scriptversion=2012-03-05.13; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free -# Software Foundation, Inc. +# Copyright (C) 1999-2012 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -79,6 +78,48 @@ func_file_conv () esac } +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () @@ -109,43 +150,34 @@ func_cl_wrapper () ;; esac ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; -l*) - lib=${1#-l} - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - set x "$@" "$dir/$lib.dll.lib" - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - set x "$@" "$dir/$lib.lib" - break - fi - done - IFS=$save_IFS - - test "$found" != yes && set x "$@" "$lib.lib" + func_cl_dashl "${1#-l}" + set x "$@" "$lib" shift ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; -L*) - func_file_conv "${1#-L}" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" + func_cl_dashL "${1#-L}" ;; -static) shared=false diff --git a/build-aux/config.guess b/build-aux/config.guess index d622a44..de8e6dd 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -138,6 +138,16 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_MACHINE}" in + i?86) + test -z "$VENDOR" && VENDOR=pc + ;; + *) + test -z "$VENDOR" && VENDOR=unknown + ;; +esac +test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -202,19 +212,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo ${UNAME_MACHINE}-${VENDOR}-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo ${UNAME_MACHINE}-${VENDOR}-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-${VENDOR}-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo ${UNAME_MACHINE}-${VENDOR}-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in @@ -282,13 +292,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 + echo m68k-${VENDOR}-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo ${UNAME_MACHINE}-${VENDOR}-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo ${UNAME_MACHINE}-${VENDOR}-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -303,7 +313,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos + echo arm-${VENDOR}-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp @@ -411,7 +421,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-${VENDOR}-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} @@ -722,9 +732,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo ${UNAME_MACHINE}-${VENDOR}-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo ${UNAME_MACHINE}-${VENDOR}-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -784,18 +794,18 @@ EOF echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-${VENDOR}-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -820,10 +830,10 @@ EOF echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-${VENDOR}-interix${UNAME_RELEASE} exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-${VENDOR}-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) @@ -842,31 +852,31 @@ EOF echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin + echo x86_64-${VENDOR}-cygwin exit ;; p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin + echo powerpcle-${VENDOR}-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-${VENDOR}-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -880,26 +890,26 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu @@ -908,10 +918,10 @@ EOF echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -925,13 +935,13 @@ EOF echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -950,54 +960,54 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-${VENDOR}-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-${VENDOR}-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;; + PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;; + *) echo hppa-${VENDOR}-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-${VENDOR}-linux-gnu exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-${VENDOR}-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1019,16 +1029,16 @@ EOF echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo ${UNAME_MACHINE}-${VENDOR}-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo ${UNAME_MACHINE}-${VENDOR}-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-${VENODR}-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp @@ -1048,7 +1058,7 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then @@ -1087,7 +1097,7 @@ EOF if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-${VENODR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1124,19 +1134,19 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} @@ -1186,7 +1196,7 @@ EOF if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-${VENDOR}-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1280,13 +1290,13 @@ EOF else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo ${UNAME_MACHINE}-${VENDOR}-plan9 exit ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 + echo pdp10-${VENDOR}-tops10 exit ;; *:TENEX:*:*) - echo pdp10-unknown-tenex + echo pdp10-${VENDOR}-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 @@ -1295,16 +1305,16 @@ EOF echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 + echo pdp10-${VENDOR}-tops20 exit ;; *:ITS:*:*) - echo pdp10-unknown-its + echo pdp10-${VENDOR}-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1326,7 +1336,7 @@ EOF echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo ${UNAME_MACHINE}-${VENDOR}-esx exit ;; esac diff --git a/build-aux/config.sub b/build-aux/config.sub index c894da4..59bb593 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -225,6 +225,12 @@ case $os in -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; -lynx*) os=-lynxos ;; diff --git a/build-aux/depcomp b/build-aux/depcomp index bd0ac08..debb6ff 100755 --- a/build-aux/depcomp +++ b/build-aux/depcomp @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-12-04.11; # UTC +scriptversion=2012-03-27.16; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +27,7 @@ scriptversion=2011-12-04.11; # UTC case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) @@ -40,8 +39,8 @@ as side-effects. Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. @@ -57,6 +56,12 @@ EOF ;; esac +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -102,6 +107,12 @@ if test "$depmode" = msvc7msys; then depmode=msvc7 fi +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -156,15 +167,14 @@ gcc) ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. @@ -203,18 +213,15 @@ sgi) # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else @@ -226,10 +233,17 @@ sgi) rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` @@ -259,12 +273,11 @@ aix) test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. + # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. + # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -275,23 +288,26 @@ aix) ;; icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h - # which is wrong. We want: + # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : @@ -300,15 +316,21 @@ icc) exit $stat fi rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; @@ -344,7 +366,7 @@ hp2) done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// @@ -359,9 +381,9 @@ hp2) tru64) # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. + # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= @@ -407,8 +429,7 @@ tru64) done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi @@ -443,11 +464,11 @@ msvc7) p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g -s/\(.*\)/ \1 \\/p +s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { - s/.*/ / + s/.*/'"$tab"'/ G p }' >> "$depfile" @@ -478,7 +499,7 @@ dashmstdout) shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -498,15 +519,14 @@ dashmstdout) done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ + tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -562,8 +582,7 @@ makedepend) # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -583,7 +602,7 @@ cpp) shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -652,8 +671,8 @@ msvisualcpp) sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff --git a/build-aux/install-sh b/build-aux/install-sh index a9244eb..377bb86 100755 --- a/build-aux/install-sh +++ b/build-aux/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-01-19.21; # UTC +scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ scriptversion=2011-01-19.21; # UTC # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,7 +156,7 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -190,7 +190,7 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -202,7 +202,7 @@ if test $# -eq 0; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi @@ -240,7 +240,7 @@ fi for src do - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac @@ -354,7 +354,7 @@ do if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. + # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh index c2852d8..63ae69d 100644 --- a/build-aux/ltmain.sh +++ b/build-aux/ltmain.sh @@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 +# $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1ubuntu1" +VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 @@ -6124,10 +6124,7 @@ func_mode_link () case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then @@ -6447,19 +6444,19 @@ func_mode_link () # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done continue fi # $pass = conv @@ -7352,9 +7349,6 @@ func_mode_link () revision="$number_minor" lt_irix_increment=no ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; esac ;; no) diff --git a/build-aux/missing b/build-aux/missing index 86a8fc3..9a55648 100755 --- a/build-aux/missing +++ b/build-aux/missing @@ -1,10 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2012-01-06.13; # UTC +scriptversion=2012-01-06.18; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +# Copyright (C) 1996-2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -26,7 +25,7 @@ scriptversion=2012-01-06.13; # UTC # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi @@ -34,7 +33,7 @@ run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' -# In the cases where this matters, `missing' is being run in the +# In the cases where this matters, 'missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac @@ -65,7 +64,7 @@ case $1 in echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: @@ -74,20 +73,20 @@ Options: --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' + aclocal touch file 'aclocal.m4' + autoconf touch file 'configure' + autoheader touch file 'config.h.in' autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c + automake touch all 'Makefile.in' files + bison create 'y.tab.[ch]', if possible, from existing .[ch] + flex create 'lex.yy.c', if possible, from existing .c help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c + lex create 'lex.yy.c', if possible, from existing .c makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + yacc create 'y.tab.[ch]', if possible, from existing .[ch] -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -99,8 +98,8 @@ Send bug reports to ." ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: Unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; @@ -127,7 +126,7 @@ case $1 in exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether + # running '$TOOL --version' or '$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi @@ -139,27 +138,27 @@ esac case $program in aclocal*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from +WARNING: '$1' is $msg. You should only need it if + you modified 'acinclude.m4' or '${configure_ac}'. You might want + to install the Automake and Perl packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU +WARNING: '$1' is $msg. You should only need it if + you modified '${configure_ac}'. You might want to install the + Autoconf and GNU m4 packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them +WARNING: '$1' is $msg. You should only need it if + you modified 'acconfig.h' or '${configure_ac}'. You might want + to install the Autoconf and GNU m4 packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" @@ -176,9 +175,9 @@ WARNING: \`$1' is $msg. You should only need it if automake*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. +WARNING: '$1' is $msg. You should only need it if + you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'. + You might want to install the Automake and Perl packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | @@ -187,10 +186,10 @@ WARNING: \`$1' is $msg. You should only need it if autom4te*) echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. +WARNING: '$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU + You can get '$1' as part of Autoconf from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` @@ -210,10 +209,10 @@ WARNING: \`$1' is needed, but is $msg. bison*|yacc*) echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package +WARNING: '$1' $msg. You should only need it if + you modified a '.y' file. You may need the Bison package in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." + Bison from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} @@ -240,10 +239,10 @@ WARNING: \`$1' $msg. You should only need it if lex*|flex*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package +WARNING: '$1' is $msg. You should only need it if + you modified a '.l' file. You may need the Flex package in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." + Flex from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} @@ -263,10 +262,10 @@ WARNING: \`$1' is $msg. You should only need it if help2man*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if +WARNING: '$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." + Help2man package in order for those modifications to take + effect. You can get Help2man from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` @@ -281,12 +280,12 @@ WARNING: \`$1' is $msg. You should only need it if makeinfo*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file +WARNING: '$1' is $msg. You should only need it if + you modified a '.texi' or '.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." + call might also be the consequence of using a buggy 'make' (AIX, + DU, IRIX). You might want to install the Texinfo package or + the GNU make package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` @@ -310,12 +309,12 @@ WARNING: \`$1' is $msg. You should only need it if *) echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. +WARNING: '$1' is needed, and is $msg. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, + proper tools for further handling them. Check the 'README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." + some other package would contain this missing '$1' program." exit 1 ;; esac diff --git a/build-aux/py-compile b/build-aux/py-compile index 15c834c..699e28f 100755 --- a/build-aux/py-compile +++ b/build-aux/py-compile @@ -3,8 +3,7 @@ scriptversion=2011-06-08.12; # UTC -# Copyright (C) 2000, 2001, 2003, 2004, 2005, 2008, 2009, 2011 Free -# Software Foundation, Inc. +# Copyright (C) 2000-2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/configure b/configure index 9e06377..9e6bb61 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libgsignon-glib 2.0.3. +# Generated by GNU Autoconf 2.68 for libgsignon-glib 2.1.0. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libgsignon-glib' PACKAGE_TARNAME='libgsignon-glib' -PACKAGE_VERSION='2.0.3' -PACKAGE_STRING='libgsignon-glib 2.0.3' +PACKAGE_VERSION='2.1.0' +PACKAGE_STRING='libgsignon-glib 2.1.0' PACKAGE_BUGREPORT='http://code.google.com/p/accounts-sso/issues/entry' PACKAGE_URL='http://code.google.com/p/accounts-sso/' @@ -1369,7 +1369,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libgsignon-glib 2.0.3 to adapt to many kinds of systems. +\`configure' configures libgsignon-glib 2.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1439,7 +1439,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libgsignon-glib 2.0.3:";; + short | recursive ) echo "Configuration of libgsignon-glib 2.1.0:";; esac cat <<\_ACEOF @@ -1579,7 +1579,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libgsignon-glib configure 2.0.3 +libgsignon-glib configure 2.1.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1857,7 +1857,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libgsignon-glib $as_me 2.0.3, which was +It was created by libgsignon-glib $as_me 2.1.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2717,7 +2717,7 @@ fi # Define the identity of the package. PACKAGE='libgsignon-glib' - VERSION='2.0.3' + VERSION='2.1.0' cat >>confdefs.h <<_ACEOF @@ -13753,7 +13753,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libgsignon-glib $as_me 2.0.3, which was +This file was extended by libgsignon-glib $as_me 2.1.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13820,7 +13820,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libgsignon-glib config.status 2.0.3 +libgsignon-glib config.status 2.1.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 2cf6a8b..dc32299 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.64]) AC_INIT([libgsignon-glib], - [2.0.3], + [2.1.0], [http://code.google.com/p/accounts-sso/issues/entry], [libgsignon-glib], [http://code.google.com/p/accounts-sso/]) diff --git a/dists/debian/changelog b/dists/debian/changelog index f6b07ef..17eba58 100644 --- a/dists/debian/changelog +++ b/dists/debian/changelog @@ -1,3 +1,15 @@ +libgsignon-glib (2.1.0-4) unstable; urgency=low + + * Release 2.1.0 + + -- Jussi Laako Thu, 06 Mar 2014 17:59:00 +0200 + +libgsignon-glib (2.0.1-3) unstable; urgency=low + + * Minor update + + -- Jussi Laako Wed, 08 Jan 2014 17:41:00 +0200 + libgsignon-glib (2.0.1-2) unstable; urgency=low * Produce a separate debug symbols package diff --git a/dists/debian/rules b/dists/debian/rules index d4d423c..94b571b 100755 --- a/dists/debian/rules +++ b/dists/debian/rules @@ -3,6 +3,9 @@ DEB_CONFIGURE_EXTRA_FLAGS += --enable-dbus-type=session +# Optionally build a debug version +#DEB_CONFIGURE_EXTRA_FLAGS += --enable-debug + # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 diff --git a/dists/rpm/libgsignon-glib-suse.spec b/dists/rpm/libgsignon-glib-suse.spec index ab84170..3c930d8 100644 --- a/dists/rpm/libgsignon-glib-suse.spec +++ b/dists/rpm/libgsignon-glib-suse.spec @@ -3,7 +3,7 @@ Name: libgsignon-glib Summary: GLib API for the SSO framework -Version: 2.0.3 +Version: 2.1.0 Release: 1 Group: System/Libraries License: LGPL-2.1 @@ -82,6 +82,9 @@ rm -rf %{buildroot} %changelog +* Thu Mar 06 2014 Jussi Laako +- Release 2.1.0 including API alignment with libsignon-glib + * Mon Nov 25 2013 Imran Zaman - Release 2.0.3 that fixes unit test and spec file bugs diff --git a/dists/rpm/libgsignon-glib-tizen.changes b/dists/rpm/libgsignon-glib-tizen.changes index edbbf20..e3410fc 100644 --- a/dists/rpm/libgsignon-glib-tizen.changes +++ b/dists/rpm/libgsignon-glib-tizen.changes @@ -1,3 +1,6 @@ +* Thu Mar 06 2014 Jussi Laako +- Release 2.1.0 including API alignment with libsignon-glib + * Mon Nov 25 2013 Imran Zaman - Release 2.0.3 that fixes unit test and spec file bugs diff --git a/dists/rpm/libgsignon-glib-tizen.spec b/dists/rpm/libgsignon-glib-tizen.spec index 739c158..1d48218 100644 --- a/dists/rpm/libgsignon-glib-tizen.spec +++ b/dists/rpm/libgsignon-glib-tizen.spec @@ -3,7 +3,7 @@ Name: libgsignon-glib Summary: GLib API for the SSO framework -Version: 2.0.3 +Version: 2.1.0 Release: 1 Group: System/Libraries License: LGPL-2.1 diff --git a/docs/reference/examples.xml b/docs/reference/examples.xml index 830d8f6..2252c17 100644 --- a/docs/reference/examples.xml +++ b/docs/reference/examples.xml @@ -65,8 +65,8 @@ Available authentication mechanisms for method oauth: > gsso-example --query-identities Available identities: - id=27 caption='My test identity' - id=28 caption='Another test identity' + id=27 caption='My test identity' ACL: (*:*) + id=28 caption='Another test identity' ACL: (/usr/bin/gsso-example:) @@ -79,6 +79,15 @@ Identity stored with id 28 + Depending on the identity method, you may also need to add a list of comma-separated + realms that are allowed to be used with an identity. For example, the oauth method + requires a list of domains that the OAuth authentication plugin is allowed to contact: + +> gsso-example --create-identity="Test Google identity" --identity-method=oauth --identity-realms=google.com +Identity stored with id 29 + + + To remove an identity, use --remove-identity option with identity id: @@ -86,6 +95,22 @@ Identity stored with id 28 Identity removed + + To add security context to identity's Access Control List, use --add-context option + with identity id: + +> gsso-example --add-context=28 --system-context=* --application-context=* +Identity stored with id 28 + + + + To remove security context from identity's Access Control List, use --remove-context= option + with identity id: + +> gsso-example --remove-context=28 --system-context=* --application-context=* +Identity stored with id 28 + + Using 'password' authentication method diff --git a/docs/reference/html/SignonAuthService.html b/docs/reference/html/SignonAuthService.html new file mode 100644 index 0000000..b4ecbb1 --- /dev/null +++ b/docs/reference/html/SignonAuthService.html @@ -0,0 +1,486 @@ + + + + +libgsignon-glib Reference Manual: SignonAuthService + + + + + + + + + + + + + + + + +
+
+
+ + +
+

SignonAuthService

+

SignonAuthService — the authorization service object

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+void + +(*SignonQueryIdentitiesCb) () +
+void + +(*SignonQueryMechanismCb) () +
+void + +(*SignonQueryMethodsCb) () +
+SignonAuthService * + +signon_auth_service_new () +
+void + +signon_auth_service_query_identities () +
+void + +signon_auth_service_query_mechanisms () +
+void + +signon_auth_service_query_methods () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + +
structSignonAuthService
structSignonAuthServiceClass
typedefSignonIdentityFilter
typedefSignonIdentityList
+
+
+

Object Hierarchy

+
    GObject
+    ╰── SignonAuthService
+
+
+
+

Description

+

The SignonAuthService is the main object in this library. It provides top-level +functions to query existing identities, available methods and their mechanisms.

+
+
+

Functions

+
+

SignonQueryIdentitiesCb ()

+
void
+(*SignonQueryIdentitiesCb) (SignonAuthService *auth_service,
+                            SignonIdentityList *identities,
+                            const GError *error,
+                            gpointer user_data);
+

Callback to be passed to signon_auth_service_query_identities().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

auth_service

the SignonAuthService.

 

identities

GList based list of SignonIdentityInfo.

[transfer full]

error

a GError if an error occurred, NULL otherwise.

 

user_data

the user data that was passed when installing this callback.

 
+
+
+
+
+

SignonQueryMechanismCb ()

+
void
+(*SignonQueryMechanismCb) (SignonAuthService *auth_service,
+                           const gchar *method,
+                           gchar **mechanisms,
+                           const GError *error,
+                           gpointer user_data);
+

Callback to be passed to signon_auth_service_query_mechanisms().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

auth_service

the SignonAuthService.

 

method

the authentication method being inspected.

 

mechanisms

list of available mechanisms.

[transfer full][type GStrv]

error

a GError if an error occurred, NULL otherwise.

 

user_data

the user data that was passed when installing this callback.

 
+
+
+
+
+

SignonQueryMethodsCb ()

+
void
+(*SignonQueryMethodsCb) (SignonAuthService *auth_service,
+                         gchar **methods,
+                         const GError *error,
+                         gpointer user_data);
+

Callback to be passed to signon_auth_service_query_methods().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

auth_service

the SignonAuthService.

 

methods

list of available methods.

[transfer full][type GStrv]

error

a GError if an error occurred, NULL otherwise.

 

user_data

the user data that was passed when installing this callback.

 
+
+
+
+
+

signon_auth_service_new ()

+
SignonAuthService *
+signon_auth_service_new ();
+

Create a new SignonAuthService.

+
+

Returns

+

an instance of an SignonAuthService.

+

+
+
+
+
+

signon_auth_service_query_identities ()

+
void
+signon_auth_service_query_identities (SignonAuthService *auth_service,
+                                      SignonIdentityFilter *filter,
+                                      const gchar *application_context,
+                                      SignonQueryIdentitiesCb cb,
+                                      gpointer user_data);
+

Query available identities, possibly applying a filter.

+

filter + is a GHashTable that contains filter conditions in the form of +string keys and GVariant values. Currently the following keys are supported:

+
+

The meaning of application_context + is explained in SignonSecurityContext. +It is used by GSignondAccessControlManager to determine if the requesting +application is a keychain application. If it is, then all identites will be +returned (subject to "Owner" key in filter +). If it's not, then only the +identites which the application owns will be returned (but "Type" and "Caption" +can still be set in the filter +).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

auth_service

the SignonAuthService.

 

filter

filter variant dictionary based on GHashTable.

 

application_context

application security context, can be NULL.

 

cb

callback to be invoked.

[scope async]

user_data

user data.

 
+
+
+
+
+

signon_auth_service_query_mechanisms ()

+
void
+signon_auth_service_query_mechanisms (SignonAuthService *auth_service,
+                                      const gchar *method,
+                                      SignonQueryMechanismCb cb,
+                                      gpointer user_data);
+

Lists all the available mechanisms for an authentication method.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

auth_service

the SignonAuthService.

 

method

the name of the method whose mechanisms must be +retrieved.

 

cb

callback to be invoked.

[scope async]

user_data

user data.

 
+
+
+
+
+

signon_auth_service_query_methods ()

+
void
+signon_auth_service_query_methods (SignonAuthService *auth_service,
+                                   SignonQueryMethodsCb cb,
+                                   gpointer user_data);
+

Lists all the available authentication methods.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

auth_service

the SignonAuthService.

 

cb

callback to be invoked.

[scope async]

user_data

user data.

 
+
+
+
+
+

Types and Values

+
+

struct SignonAuthService

+
struct SignonAuthService;
+

Opaque struct. Use the accessor functions below.

+
+
+
+

struct SignonAuthServiceClass

+
struct SignonAuthServiceClass {
+    GObjectClass parent_class;
+};
+
+

Opaque struct. Use the accessor functions below.

+
+

Members

+
+++++ + + + + + +

GObjectClass parent_class;

a reference to the parent class

 
+
+
+
+
+

SignonIdentityFilter

+
typedef GHashTable SignonIdentityFilter;
+
+

GHashTable based filter variant dictionary.

+
+
+
+

SignonIdentityList

+
typedef GList SignonIdentityList;
+
+

GList of SignonIdentity items.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/SignonAuthSession.html b/docs/reference/html/SignonAuthSession.html index 4e6ad53..e225e0f 100644 --- a/docs/reference/html/SignonAuthSession.html +++ b/docs/reference/html/SignonAuthSession.html @@ -2,36 +2,29 @@ -SignonAuthSession - +libgsignon-glib Reference Manual: SignonAuthSession + - + - - - - - - - - - - + + + + + + +
@@ -39,615 +32,863 @@

SignonAuthSession

SignonAuthSession — the authentication session object

- +
-
-

Synopsis

-
#define             SIGNON_SESSION_DATA_CAPTION
-#define             SIGNON_SESSION_DATA_PROXY
-#define             SIGNON_SESSION_DATA_REALM
-#define             SIGNON_SESSION_DATA_RENEW_TOKEN
-#define             SIGNON_SESSION_DATA_SECRET
-#define             SIGNON_SESSION_DATA_TIMEOUT
-#define             SIGNON_SESSION_DATA_UI_POLICY
-#define             SIGNON_SESSION_DATA_USERNAME
-#define             SIGNON_SESSION_DATA_WINDOW_ID
-struct              SignonAuthSession;
-struct              SignonAuthSessionClass;
-void                (*SignonAuthSessionProcessCb)       (SignonAuthSession *self,
-                                                         GHashTable *session_data,
-                                                         const GError *error,
-                                                         gpointer user_data);
-void                (*SignonAuthSessionQueryAvailableMechanismsCb)
-                                                        (SignonAuthSession *self,
-                                                         gchar **mechanisms,
-                                                         const GError *error,
-                                                         gpointer user_data);
-enum                SignonSessionDataUiPolicy;
-void                signon_auth_session_cancel          (SignonAuthSession *self);
-const gchar *       signon_auth_session_get_method      (SignonAuthSession *self);
-SignonAuthSession * signon_auth_session_new             (GObject *parent,
-                                                         const gchar *method_name,
-                                                         GError **err);
-void                signon_auth_session_process         (SignonAuthSession *self,
-                                                         const GHashTable *session_data,
-                                                         const gchar *mechanism,
-                                                         SignonAuthSessionProcessCb cb,
-                                                         gpointer user_data);
-void                signon_auth_session_process_async   (SignonAuthSession *self,
-                                                         GVariant *session_data,
-                                                         const gchar *mechanism,
-                                                         GCancellable *cancellable,
-                                                         GAsyncReadyCallback callback,
-                                                         gpointer user_data);
-GVariant *          signon_auth_session_process_finish  (SignonAuthSession *self,
-                                                         GAsyncResult *res,
-                                                         GError **error);
-void                signon_auth_session_query_available_mechanisms
-                                                        (SignonAuthSession *self,
-                                                         const gchar **wanted_mechanisms,
-                                                         SignonAuthSessionQueryAvailableMechanismsCb cb,
-                                                         gpointer user_data);
-
-
-

Object Hierarchy

-
-  GObject
-   +----SignonAuthSession
-
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+void + +(*SignonAuthSessionProcessCb) () +
+void + +(*SignonAuthSessionQueryAvailableMechanismsCb) () +
+void + +signon_auth_session_cancel () +
const gchar * + +signon_auth_session_get_method () +
+SignonAuthSession * + +signon_auth_session_new () +
+SignonAuthSession * + +signon_auth_session_new_for_identity () +
+void + +signon_auth_session_process () +
+void + +signon_auth_session_process_async () +
+GVariant * + +signon_auth_session_process_finish () +
+void + +signon_auth_session_query_available_mechanisms () +

Properties

-
-  "identity"                 SignonIdentity*       : Read / Write / Construct Only
-
-
-
-

Signals

-
-  "state-changed"                                  : Action
-
-
-
-

Description

-

-The SignonAuthSession object is responsible for handling the client -authentication. SignonAuthSession objects should be created from existing -identities (via signon_identity_create_session() or by passing a non-NULL identity -to signon_auth_session_new()), in which case the authentication data such as -username and password will be implicitly taken from the identity. -

-
-
-

Details

-
-

SIGNON_SESSION_DATA_CAPTION

-
#define SIGNON_SESSION_DATA_CAPTION       "Caption"
-
-

-Caption for the UI dialog. -

-
-
-
-

SIGNON_SESSION_DATA_PROXY

-
#define SIGNON_SESSION_DATA_PROXY         "NetworkProxy"
-
-

-Proxy. -

-
-
-
-

SIGNON_SESSION_DATA_REALM

-
#define SIGNON_SESSION_DATA_REALM         "Realm"
-
-

-Realm. -

-
-
-
-

SIGNON_SESSION_DATA_RENEW_TOKEN

-
#define SIGNON_SESSION_DATA_RENEW_TOKEN   "RenewToken"
-
-

-Requests the signon plugin to obtain a new token (boolean). -

-
-
-
-

SIGNON_SESSION_DATA_SECRET

-
#define SIGNON_SESSION_DATA_SECRET        "Secret"
-
-

-Secret. -

-
-
-
-

SIGNON_SESSION_DATA_TIMEOUT

-
#define SIGNON_SESSION_DATA_TIMEOUT       "NetworkTimeout"
-
-

-Network timeout, in milliseconds (uint32). -

-
-
-
-

SIGNON_SESSION_DATA_UI_POLICY

-
#define SIGNON_SESSION_DATA_UI_POLICY     "UiPolicy"
-
-

-Policy for the signon process. -

-
-+
+++++ - - + + +

see_also :

SignonSessionDataUiPolicy +SignonIdentity *identityRead / Write / Construct Only
-
-
-

SIGNON_SESSION_DATA_USERNAME

-
#define SIGNON_SESSION_DATA_USERNAME      "UserName"
-
-

-Username. -

-
-
-
-

SIGNON_SESSION_DATA_WINDOW_ID

-
#define SIGNON_SESSION_DATA_WINDOW_ID     "WindowId"
-
-

-Platform-specific window id (for dialog transiency) - uint32. -

-
-
-
-

struct SignonAuthSession

-
struct SignonAuthSession;
-

-Opaque struct. Use the accessor functions below. -

-
-
-
-

struct SignonAuthSessionClass

-
struct SignonAuthSessionClass {
-    GObjectClass parent;
-};
-
-

-Opaque struct. Use the accessor functions below. -

-
-+
+

Signals

+
+++++ - - + + +

GObjectClass parent;

reference to the parent classvoidstate-changedAction
-
-
-

SignonAuthSessionProcessCb ()

-
void                (*SignonAuthSessionProcessCb)       (SignonAuthSession *self,
-                                                         GHashTable *session_data,
-                                                         const GError *error,
-                                                         gpointer user_data);
-
-

Warning

-

SignonAuthSessionProcessCb is deprecated and should not be used in newly-written code.

-
-

-This callback is invoked when the authentication plugin delivers the result -of the signon_auth_session_process() operation. -

-
-+
+

Types and Values

+
++++ - - + + - - + + + + + + + + + + + + + + + + + + - - + + - - + + + + + + + + + + + + + + + + + +

self :

the SignonAuthSession.#defineSIGNON_SESSION_DATA_CAPTION

session_data :

a dictionary with -the response. [transfer full][element-type utf8 GValue] -#defineSIGNON_SESSION_DATA_PROXY
#defineSIGNON_SESSION_DATA_REALM
#defineSIGNON_SESSION_DATA_RENEW_TOKEN
#defineSIGNON_SESSION_DATA_SECRET
#defineSIGNON_SESSION_DATA_TIMEOUT

error :

a GError if an error occurred, NULL otherwise.#defineSIGNON_SESSION_DATA_UI_POLICY

user_data :

the user data that was passed when installing this callback.#defineSIGNON_SESSION_DATA_USERNAME
#defineSIGNON_SESSION_DATA_WINDOW_ID
structSignonAuthSession
structSignonAuthSessionClass
enumSignonSessionDataUiPolicy
-
+
+

Object Hierarchy

+
    GObject
+    ╰── SignonAuthSession
+
+
+
+

Description

+

The SignonAuthSession object is responsible for handling the client +authentication. SignonAuthSession objects should be created from existing +identities (via signon_identity_create_session() or by passing a non-NULL identity +to signon_auth_session_new()).

+
+
+

Functions

-

SignonAuthSessionQueryAvailableMechanismsCb ()

-
void                (*SignonAuthSessionQueryAvailableMechanismsCb)
-                                                        (SignonAuthSession *self,
-                                                         gchar **mechanisms,
-                                                         const GError *error,
-                                                         gpointer user_data);
-

-Callback to be passed to signon_auth_session_query_available_mechanisms(). -

-
-+

SignonAuthSessionProcessCb ()

+
void
+(*SignonAuthSessionProcessCb) (SignonAuthSession *self,
+                               GHashTable *session_data,
+                               const GError *error,
+                               gpointer user_data);
+

SignonAuthSessionProcessCb is deprecated and should not be used in newly-written code.

+

This callback is invoked when the authentication plugin delivers the result +of the signon_auth_session_process() operation.

+
+

Parameters

+
+++++ - - + + + - - + + + - - + + + - - + + +

self :

the SignonAuthSession.

self

the SignonAuthSession.

 

mechanisms :

list of available mechanisms. [transfer full][type GStrv] -

session_data

a dictionary with +the response.

[transfer full][element-type utf8 GValue]

error :

a GError if an error occurred, NULL otherwise.

error

a GError if an error occurred, NULL otherwise.

 

user_data :

the user data that was passed when installing this callback.

user_data

the user data that was passed when installing this callback.

 
+

-

enum SignonSessionDataUiPolicy

-
typedef enum {
-    SIGNON_POLICY_DEFAULT = 0,
-    SIGNON_POLICY_REQUEST_PASSWORD,
-    SIGNON_POLICY_NO_USER_INTERACTION,
-    SIGNON_POLICY_VALIDATION,
-} SignonSessionDataUiPolicy;
-
-

-UI policy for the signon process, passed to the UI plugin. -

-
-+

SignonAuthSessionQueryAvailableMechanismsCb ()

+
void
+(*SignonAuthSessionQueryAvailableMechanismsCb)
+                               (SignonAuthSession *self,
+                                gchar **mechanisms,
+                                const GError *error,
+                                gpointer user_data);
+

Callback to be passed to signon_auth_session_query_available_mechanisms().

+
+

Parameters

+
+++++ - - + + + - - + + + - - + + + - - + + +

SIGNON_POLICY_DEFAULT

The plugin can decide when to show UI. -

self

the SignonAuthSession.

 

SIGNON_POLICY_REQUEST_PASSWORD

Force the user to enter the password. -

mechanisms

list of available mechanisms.

[transfer full][type GStrv]

SIGNON_POLICY_NO_USER_INTERACTION

No UI elements will be shown to the user. -

error

a GError if an error occurred, NULL otherwise.

 

SIGNON_POLICY_VALIDATION

UI elements can be shown to the user only when -CAPTCHA-like security measures are required. -

user_data

the user data that was passed when installing this callback.

 
+

-

signon_auth_session_cancel ()

-
void                signon_auth_session_cancel          (SignonAuthSession *self);
-

-Cancel the authentication session. -

-
-+

signon_auth_session_cancel ()

+
void
+signon_auth_session_cancel (SignonAuthSession *self);
+

Cancel the authentication session.

+
+

Parameters

+
+++++ - - + + +

self :

the SignonAuthSession.

self

the SignonAuthSession.

 
+

-

signon_auth_session_get_method ()

-
const gchar *       signon_auth_session_get_method      (SignonAuthSession *self);
-

-Get the current authentication method. -

-
-+

signon_auth_session_get_method ()

+
const gchar *
+signon_auth_session_get_method (SignonAuthSession *self);
+

Get the current authentication method.

+
+

Parameters

+
+++++ + + + + + +

self

the SignonAuthSession.

 
+
+
+

Returns

+

the authentication method being used, or NULL on failure.

+

+
+ +
+
+

signon_auth_session_new ()

+
SignonAuthSession *
+signon_auth_session_new (gint id,
+                         const gchar *method_name,
+                         GError **err);
+

Creates a new SignonAuthSession, which can be used to authenticate using +the specified method.

+
+

Parameters

+
+++++ - - + + + + + + + + - - + + +

self :

the SignonAuthSession.

id

the id of the SignonIdentity to be used. Can be 0, if this session is +not bound to any stored identity.

 

method_name

the name of the authentication method to be used.

 

Returns :

the authentication method being used, or NULL on failure.

err

a pointer to a location which will contain the error, in case this +function fails.

 
+
+

Returns

+

a new SignonAuthSession.

+

+
+

-

signon_auth_session_new ()

-
SignonAuthSession * signon_auth_session_new             (GObject *parent,
-                                                         const gchar *method_name,
-                                                         GError **err);
-

-Creates a new SignonAuthSession, which can be used to authenticate using -the specified method. -

-
-+

signon_auth_session_new_for_identity ()

+
SignonAuthSession *
+signon_auth_session_new_for_identity (SignonIdentity *identity,
+                                      const gchar *method_name,
+                                      GError **err);
+

Creates a new SignonAuthSession, which can be used to authenticate using +the specified method.

+
+

Parameters

+
+++++ - - - - - - + + + - - + + + - - + + +

parent :

-SignonIdentity parent object.

method_name :

the name of the authentication method to be used.

identity

SignonIdentity parent object.

 

err :

a pointer to a location which will contain the error, in case this -function fails.

method_name

the name of the authentication method to be used.

 

Returns :

a new SignonAuthSession.

err

a pointer to a location which will contain the error, in case this +function fails.

 
+
+

Returns

+

a new SignonAuthSession.

+

+
+
-

signon_auth_session_process ()

-
void                signon_auth_session_process         (SignonAuthSession *self,
-                                                         const GHashTable *session_data,
-                                                         const gchar *mechanism,
-                                                         SignonAuthSessionProcessCb cb,
-                                                         gpointer user_data);
-
-

Warning

-

signon_auth_session_process has been deprecated since version 1.8 and should not be used in newly-written code. Use signon_auth_session_process_async() instead.

-
-

-Performs one step of the authentication process. If the SignonIdentity that +

signon_auth_session_process ()

+
void
+signon_auth_session_process (SignonAuthSession *self,
+                             GHashTable *session_data,
+                             const gchar *mechanism,
+                             SignonAuthSessionProcessCb cb,
+                             gpointer user_data);
+
+

signon_auth_session_process has been deprecated since version 1.8 and should not be used in newly-written code.

+

Use signon_auth_session_process_async() instead.

+
+

Performs one step of the authentication process. If the SignonIdentity that this session belongs to contains a username and a password, they will be also passed to the authentication plugin, otherwise they should be set directly in -session_data. -session_data should be used to add additional authentication parameters to the -session, or to override the parameters otherwise taken from the identity. -

-
-+session_data +. +session_data + should be used to add additional authentication parameters to the +session, or to override the parameters otherwise taken from the identity.

+
+

Parameters

+
+++++ - - + + + - - + + + - - + + + - - + + + - - + + +

self :

the SignonAuthSession.

self

the SignonAuthSession.

 

session_data :

a dictionary of parameters. [transfer none][element-type utf8 GValue] -

session_data

a dictionary of parameters.

[transfer none][element-type utf8 GValue]

mechanism :

the authentication mechanism to be used.

mechanism

the authentication mechanism to be used.

 

cb :

a callback which will be called with the result. [scope async] -

cb

a callback which will be called with the result.

[scope async]

user_data :

user data to be passed to the callback.

user_data

user data to be passed to the callback.

 
+
-

signon_auth_session_process_async ()

-
void                signon_auth_session_process_async   (SignonAuthSession *self,
-                                                         GVariant *session_data,
-                                                         const gchar *mechanism,
-                                                         GCancellable *cancellable,
-                                                         GAsyncReadyCallback callback,
-                                                         gpointer user_data);
-

-Performs one step of the authentication process. If the SignonIdentity that -this session belongs to contains a username and a password, the daemon will -pass them to the authentication plugin, otherwise they should be set directly in -session_data. -session_data should be used to add additional authentication parameters to the -session, or to override the parameters otherwise taken from the identity. -

-

-What specific parameters should be used can be found from authentication plugins' -documentation (look for parameters that are expected in gsignond_plugin_request_initial() -for the first step, and parameters that are expected in gsignond_plugin_request() for -the subsequent steps). See, for example, GSignondPasswordPlugin and GSignondDigestPlugin. -

-
-+

signon_auth_session_process_async ()

+
void
+signon_auth_session_process_async (SignonAuthSession *self,
+                                   GVariant *session_data,
+                                   const gchar *mechanism,
+                                   GCancellable *cancellable,
+                                   GAsyncReadyCallback callback,
+                                   gpointer user_data);
+

Performs one step of the authentication process. +session_data + should be used to add additional authentication parameters to the +session.

+

What specific parameters should be used can be found from authentication plugins' +documentation (look for parameters that are expected in gsignond_plugin_request_initial() +for the first step, and parameters that are expected in gsignond_plugin_request() for +the subsequent steps). See, for example, GSignondPasswordPlugin and GSignondDigestPlugin.

+

If the SignonIdentity that this session belongs to contains a username and a password, +the daemon will pass them to the authentication plugin, otherwise they should be set directly in +session_data +. The daemon also passes a list of identity's allowed realms to the plugin, +and they cannot be overriden.

+
+

Parameters

+
+++++ - - + + + - - + + + - - + + + - - + + + - - + + + - - + + +

self :

the SignonAuthSession.

self

the SignonAuthSession.

 

session_data :

a dictionary of parameters. [transfer full] -

session_data

a dictionary of parameters.

[transfer full]

mechanism :

the authentication mechanism to be used.

mechanism

the authentication mechanism to be used.

 

cancellable :

optional GCancellable object, NULL to ignore. [allow-none] -

cancellable

optional GCancellable object, NULL to ignore.

[allow-none]

callback :

a callback which will be called when the -authentication reply is available. [scope async] -

callback

a callback which will be called when the +authentication reply is available.

[scope async]

user_data :

user data to be passed to the callback.

user_data

user data to be passed to the callback.

 
+

Since 1.8


-

signon_auth_session_process_finish ()

-
GVariant *          signon_auth_session_process_finish  (SignonAuthSession *self,
-                                                         GAsyncResult *res,
-                                                         GError **error);
-

-Collect the result of the signon_auth_session_process_async() operation. -

-
-+

signon_auth_session_process_finish ()

+
GVariant *
+signon_auth_session_process_finish (SignonAuthSession *self,
+                                    GAsyncResult *res,
+                                    GError **error);
+

Collect the result of the signon_auth_session_process_async() operation.

+
+

Parameters

+
+++++ - - + + + - - + + + - - + + + - - - +

self :

the SignonAuthSession.

self

the SignonAuthSession.

 

res :

A GAsyncResult obtained from the GAsyncReadyCallback passed to -signon_auth_session_process_async().

res

A GAsyncResult obtained from the GAsyncReadyCallback passed to +signon_auth_session_process_async().

 

error :

return location for error, or NULL.

error

return location for error, or NULL.

 

Returns :

a GVariant of type G_VARIANT_TYPE_VARDICT containing the -authentication reply. As with signon_auth_session_process_async(), specific +
+
+
+

Returns

+

a GVariant of type G_VARIANT_TYPE_VARDICT containing the +authentication reply. As with signon_auth_session_process_async(), specific parameters contained in the GVariant can be found from plugins' documentation: -"response-final" for the final response, and "response" -for the intermediate responses. See, for example, GSignondPasswordPlugin -and GSignondDigestPlugin. +“response-final” for the final response, and “response” +for the intermediate responses. See, for example, GSignondPasswordPlugin +and GSignondDigestPlugin.

+

+
+

Since 1.8

+ +
+
+

signon_auth_session_query_available_mechanisms ()

+
void
+signon_auth_session_query_available_mechanisms
+                               (SignonAuthSession *self,
+                                const gchar **wanted_mechanisms,
+                                SignonAuthSessionQueryAvailableMechanismsCb cb,
+                                gpointer user_data);
+

Queries the mechanisms available for this authentication session. The result +will be the intersection between wanted_mechanisms + and the mechanisms +supported by the authentication plugin (and allowed by the SignonIdentity that this +session belongs to).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + +

self

the SignonAuthSession.

 

wanted_mechanisms

a NULL-terminated list of mechanisms supported by the client.

 

cb

a callback which will be called with the result.

[scope async]

user_data

user data to be passed to the callback.

 
-

Since 1.8

+
+
+ +
+

Types and Values

+
+

SIGNON_SESSION_DATA_CAPTION

+
#define SIGNON_SESSION_DATA_CAPTION       "Caption"
+
+

Caption for the UI dialog.


-

signon_auth_session_query_available_mechanisms ()

-
void                signon_auth_session_query_available_mechanisms
-                                                        (SignonAuthSession *self,
-                                                         const gchar **wanted_mechanisms,
-                                                         SignonAuthSessionQueryAvailableMechanismsCb cb,
-                                                         gpointer user_data);
-

-Queries the mechanisms available for this authentication session. The result -will be the intersection between wanted_mechanisms and the mechanisms -supported by the authentication plugin (and allowed by the SignonIdentity that this -session belongs to). -

-
-+

SIGNON_SESSION_DATA_PROXY

+
#define SIGNON_SESSION_DATA_PROXY         "NetworkProxy"
+
+

Proxy.

+ +
+
+

SIGNON_SESSION_DATA_REALM

+
#define SIGNON_SESSION_DATA_REALM         "Realm"
+
+

Realm.

+
+
+
+

SIGNON_SESSION_DATA_RENEW_TOKEN

+
#define SIGNON_SESSION_DATA_RENEW_TOKEN   "RenewToken"
+
+

Requests the signon plugin to obtain a new token (boolean).

+
+
+
+

SIGNON_SESSION_DATA_SECRET

+
#define SIGNON_SESSION_DATA_SECRET        "Secret"
+
+

Secret.

+
+
+
+

SIGNON_SESSION_DATA_TIMEOUT

+
#define SIGNON_SESSION_DATA_TIMEOUT       "NetworkTimeout"
+
+

Network timeout, in milliseconds (uint32).

+
+
+
+

SIGNON_SESSION_DATA_UI_POLICY

+
#define SIGNON_SESSION_DATA_UI_POLICY     "UiPolicy"
+
+

Policy for the signon process.

+
+

Parameters

+
+++++ + + + + + +

see_also

SignonSessionDataUiPolicy

 
+
+
+
+
+

SIGNON_SESSION_DATA_USERNAME

+
#define SIGNON_SESSION_DATA_USERNAME      "UserName"
+
+

Username.

+
+
+
+

SIGNON_SESSION_DATA_WINDOW_ID

+
#define SIGNON_SESSION_DATA_WINDOW_ID     "WindowId"
+
+

Platform-specific window id (for dialog transiency) - uint32.

+
+
+
+

struct SignonAuthSession

+
struct SignonAuthSession;
+

Opaque struct. Use the accessor functions below.

+
+
+
+

struct SignonAuthSessionClass

+
struct SignonAuthSessionClass {
+    GObjectClass parent;
+};
+
+

Opaque struct. Use the accessor functions below.

+
+

Members

+
+++++ + + + + + +

GObjectClass parent;

reference to the parent class

 
+
+
+
+
+

enum SignonSessionDataUiPolicy

+

UI policy for the signon process, passed to the UI plugin.

+
+

Members

+
+++++ - - + + + - - + + + - - + + - - + + +

self :

the SignonAuthSession.

SIGNON_POLICY_DEFAULT

+

The plugin can decide when to show UI.

+
 

wanted_mechanisms :

a NULL-terminated list of mechanisms supported by the client.

SIGNON_POLICY_REQUEST_PASSWORD

+

Force the user to enter the password.

+
 

cb :

a callback which will be called with the result. [scope async] +

SIGNON_POLICY_NO_USER_INTERACTION

+

No UI elements will be shown to the user.

 

user_data :

user data to be passed to the callback.

SIGNON_POLICY_VALIDATION

+

UI elements can be shown to the user only when +CAPTCHA-like security measures are required.

+
 
+

Property Details

-

The "identity" property

-
  "identity"                 SignonIdentity*       : Read / Write / Construct Only
+

The “identity” property

+
  “identity”                 SignonIdentity *

Identity Object construct parameter.

+

Flags: Read / Write / Construct Only

Signal Details

-

The "state-changed" signal

-
void                user_function                      (SignonAuthSession *auth_session,
-                                                        gint               state,
-                                                        gchar             *message,
-                                                        gpointer           user_data)         : Action
-

-Emitted when the state of the SignonAuthSession changes. -FIXME: state should be registered as a GLib type (or use one from -libgsignond-common) -

-
-+

The “state-changed” signal

+
void
+user_function (SignonAuthSession *auth_session,
+               gint               state,
+               gchar             *message,
+               gpointer           user_data)
+

Emitted when the state of the SignonAuthSession changes. The state change +is initiated by GSignondPlugin via “status-changed” signal.

+
+

Parameters

+
+++++ - - + + + - - + + + - - + + + - - + + +

auth_session :

the SignonAuthSession -

auth_session

the SignonAuthSession

 

state :

the current state of the SignonAuthSession -

state

the current state of the SignonAuthSession

 

message :

the message associated with the state change

message

the message associated with the state change

 

user_data :

user data set when the signal handler was connected.

user_data

user data set when the signal handler was connected.

 
+

Flags: Action

+
+ Generated by GTK-Doc V1.20 \ No newline at end of file diff --git a/docs/reference/html/SignonIdentity.html b/docs/reference/html/SignonIdentity.html new file mode 100644 index 0000000..364ee5a --- /dev/null +++ b/docs/reference/html/SignonIdentity.html @@ -0,0 +1,1311 @@ + + + + +libgsignon-glib Reference Manual: SignonIdentity + + + + + + + + + + + + + + + + +
+
+
+ + +
+

SignonIdentity

+

SignonIdentity — client side presentation of a credential.

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+void + +(*SignonIdentityInfoCb) () +
+void + +(*SignonIdentitySessionReadyCb) () +
+void + +(*SignonIdentityStoreCredentialsCb) () +
+void + +(*SignonIdentityVerifyCb) () +
+void + +(*SignonIdentityVoidCb) () +
+void + +signon_identity_add_reference () +
+SignonAuthSession * + +signon_identity_create_session () +
+void + +signon_identity_get_auth_session () +
const GError * + +signon_identity_get_last_error () +
+SignonIdentity * + +signon_identity_new () +
+SignonIdentity * + +signon_identity_new_from_db () +
+SignonIdentity * + +signon_identity_new_with_context () +
+SignonIdentity * + +signon_identity_new_with_context_from_db () +
+void + +signon_identity_query_info () +
+void + +signon_identity_remove () +
+void + +signon_identity_remove_reference () +
+void + +signon_identity_signout () +
+void + +signon_identity_store_credentials_with_args () +
+void + +signon_identity_store_credentials_with_info () +
+void + +signon_identity_verify_secret () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + +
+gchar *app-ctxRead / Write
guintidRead / Write
+
+
+

Signals

+
+++++ + + + + + +
voidsignoutNo Hooks
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
structSignonIdentity
structSignonIdentityClass
typedefSignonIdentityReferenceAddedCb
typedefSignonIdentityReferenceRemovedCb
typedefSignonIdentityRemovedCb
typedefSignonIdentitySignedOutCb
+
+
+

Object Hierarchy

+
    GObject
+    ╰── SignonIdentity
+
+
+
+

Description

+

The SignonIdentity objects represent identities and provide operations that +can be performed on them such as identity creation, removal, starting an authentication +session, and so on.

+

Identities can also be stored and retrieved from a gSSO database, in which +case they also contain a number of properties that can be retrieved +using signon_identity_query_info() and are represented via SignonIdentityInfo. +Such identities are identified by a numeric id number and they are subject +to access control.

+
+

Operations on an identity

+
+
+
+

Data fields in SignonIdentityInfo +

+
+

These are the data fields that are stored into the database as a part of an +identity record using signon_identity_store_credentials_with_args() or +signon_identity_store_credentials_with_info() and can be retrieved using +signon_identity_query_info() or signon_auth_service_query_identities():

+
    +
  • Caption is a display name for the identity, presented to the user. Default +value is an empty caption.

  • +
  • Realms is a list of realms that the identity can be used in. +Interpretation of this field is up to the method. Typically it is +a list of internet domains allowed for an authentication request. +Default value is an empty list.

  • +
  • Type is a SignonIdentityType. Interpretation of this field is up to the application; +gSSO does not use it. Default value is SIGNON_IDENTITY_TYPE_OTHER

  • +
  • Owner is a SignonSecurityContext object, which specifies the identity +owner. Owners are allowed to perform all of the operations on the identity +specified above. By default an identity's owner is determined by gSSO daemon +using system services for the system context, and a string supplied in +signon_identity_new_with_context() for the application context.

  • +
  • ACL is a list of SignonSecurityContext objects, that specifies applications +that can access the identity to perform authentication sessions. They're not +allowed to make any changes to the identity. Default value is an empty list, +and depending on how gSSO is configured it's also possible to provide a list +with a wildcard item to relax the access control restriction +(see SignonSecurityContext).

  • +
  • Methods is a GHashTable containing method names as keys, and lists of +allowed mechanisms as values (also, a special value "*" means that any +mechanism is allowed). Only those methods and mechanisms that are in the table +are allowed to be used in authentication sessions. Default is an empty list.

  • +
  • Id is a numeric identification of the identity record in the database. The +application cannot set this, as it's determined by the daemon.

  • +
  • Username is used to provide a username to authentication plugins after +issuing signon_auth_session_process_async(). Applications can override this +by providing a username explicitly in the session_data + parameter to that +function. By default there is no username.

  • +
  • Secret is used in the same way as username, but it is write-only (cannot +be retrieved from a SignonIdentityInfo). It is also possible to prevent +secret from being stored in the database.

  • +
+
+
+

Functions

+
+

SignonIdentityInfoCb ()

+
void
+(*SignonIdentityInfoCb) (SignonIdentity *self,
+                         SignonIdentityInfo *info,
+                         const GError *error,
+                         gpointer user_data);
+

Callback to be passed to signon_identity_query_info().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

info

the SignonIdentityInfo for self +.

[transfer none]

error

a GError if an error occurred, or NULL otherwise.

 

user_data

the user data that was passed when installing this callback.

 
+
+
+
+
+

SignonIdentitySessionReadyCb ()

+
void
+(*SignonIdentitySessionReadyCb) (SignonAuthSession *self,
+                                 GError *error,
+                                 GDBusConnection *connection,
+                                 const gchar *bus_name,
+                                 const gchar *object_path);
+

Callback to be passed to signon_identity_get_auth_session().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

the SignonAuthSession.

 

error

a GError if an error occurred, or NULL otherwise.

 

connection

a GDBusConnection for the session.

 

bus_name

a D-Bus bus name for the session.

 

object_path

a D-Bus object path for the session.

 
+
+
+
+
+

SignonIdentityStoreCredentialsCb ()

+
void
+(*SignonIdentityStoreCredentialsCb) (SignonIdentity *self,
+                                     guint32 id,
+                                     const GError *error,
+                                     gpointer user_data);
+

Callback to be passed to signon_identity_store_credentials_with_args() or +signon_identity_store_credentials_with_info().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

id

the numeric ID of the identity in the database.

 

error

a GError if an error occurred, or NULL otherwise.

 

user_data

the user data that was passed when installing this callback.

 
+
+
+
+
+

SignonIdentityVerifyCb ()

+
void
+(*SignonIdentityVerifyCb) (SignonIdentity *self,
+                           gboolean valid,
+                           const GError *error,
+                           gpointer user_data);
+

Callback to be passed to signon_identity_verify_secret().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

valid

whether the secret is valid.

 

error

a GError if an error occurred, or NULL otherwise.

 

user_data

the user data that was passed when installing this callback.

 
+
+
+
+
+

SignonIdentityVoidCb ()

+
void
+(*SignonIdentityVoidCb) (SignonIdentity *self,
+                         const GError *error,
+                         gpointer user_data);
+

Generic callback to be passed to several SignonIdentity methods.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

error

a GError if an error occurred, or NULL otherwise.

 

user_data

the user data that was passed when installing this callback.

 
+
+
+
+
+

signon_identity_add_reference ()

+
void
+signon_identity_add_reference (SignonIdentity *self,
+                               const gchar *reference,
+                               SignonIdentityReferenceAddedCb cb,
+                               gpointer user_data);
+

Adds named reference to identity. Not currently supported by gSSO.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

reference

reference to be added

 

cb

callback

 

user_data

user_data.

 
+
+
+
+
+

signon_identity_create_session ()

+
SignonAuthSession *
+signon_identity_create_session (SignonIdentity *self,
+                                const gchar *method,
+                                GError **error);
+

Creates an authentication session for this identity. If the identity has been +retrieved from the database, the authentication method must be one of those +listed in signon_identity_info_get_methods(), otherwise it can be any method +supported by gSSO.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

method

authentication method.

 

error

pointer to a location which will receive the error, if any.

 
+
+
+

Returns

+

a new SignonAuthSession.

+

[transfer full]

+
+
+
+
+

signon_identity_get_auth_session ()

+
void
+signon_identity_get_auth_session (SignonIdentity *self,
+                                  SignonAuthSession *session,
+                                  const gchar *method,
+                                  SignonIdentitySessionReadyCb cb);
+

Obtain a remote object for a local session object. Should not be used by +applications.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

session

the SignonAuthSession object to get the remote object for.

 

method

method name for the session.

 

cb

completion callback.

[scope async]
+
+
+
+
+

signon_identity_get_last_error ()

+
const GError *
+signon_identity_get_last_error (SignonIdentity *identity);
+

Get the most recent error that occurred on identity +.

+
+

Parameters

+
+++++ + + + + + +

identity

the SignonIdentity.

 
+
+
+

Returns

+

a GError containing the most recent error, or NULL on failure.

+

+
+
+
+
+

signon_identity_new ()

+
SignonIdentity *
+signon_identity_new ();
+

Construct a new, empty, identity object. +This is essentially equivalent to calling signon_identity_new_with_context() +and passing NULL as the application context.

+
+

Returns

+

an instance of an SignonIdentity.

+

+
+
+
+
+

signon_identity_new_from_db ()

+
SignonIdentity *
+signon_identity_new_from_db (guint32 id);
+

Construct an identity object associated with an existing identity +record. +This is essentially equivalent to calling +signon_identity_new_with_context_from_db() and passing NULL as the +application context.

+

Applications can determine the id + either by enumerating the identities with +signon_auth_service_query_identities() (if they're the owner of the identity) +or via other means (such as the system's accounts service, or an application +configuration).

+
+

Parameters

+
+++++ + + + + + +

id

identity ID.

 
+
+
+

Returns

+

an instance of a SignonIdentity.

+

+
+
+
+
+

signon_identity_new_with_context ()

+
SignonIdentity *
+signon_identity_new_with_context (const gchar *application_context);
+

Construct a new, empty, identity object. See SignonSecurityContext for a +discussion of application_context + contents. application_context + is used to set the identity's owner +if the identity is stored to the database with signon_identity_store_credentials_with_args() +or signon_identity_store_credentials_with_info().

+
+

Parameters

+
+++++ + + + + + +

application_context

application security context, can be NULL.

 
+
+
+

Returns

+

an instance of an SignonIdentity.

+

+
+
+
+
+

signon_identity_new_with_context_from_db ()

+
SignonIdentity *
+signon_identity_new_with_context_from_db
+                               (guint32 id,
+                                const gchar *application_context);
+

Construct an identity object associated with an existing identity +record. See SignonSecurityContext for a discussion of application_context + contents. +Together with the system context it is used to determine by the gSSO daemon +if the application can access the identity (the application needs to be either the +identity's owner or to be present on the ACL).

+

Applications can determine the id + either by enumerating the identities with +signon_auth_service_query_identities() (if they're the owner of the identity) +or via other means (such as the system's accounts service, or an application +configuration).

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

id

identity ID.

 

application_context

application security context, can be NULL.

 
+
+
+

Returns

+

an instance of a SignonIdentity.

+

+
+
+
+
+

signon_identity_query_info ()

+
void
+signon_identity_query_info (SignonIdentity *self,
+                            SignonIdentityInfoCb cb,
+                            gpointer user_data);
+

Fetches the SignonIdentityInfo data associated with this +identity.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

cb

callback.

[scope async]

user_data

user_data.

 
+
+
+
+
+

signon_identity_remove ()

+
void
+signon_identity_remove (SignonIdentity *self,
+                        SignonIdentityRemovedCb cb,
+                        gpointer user_data);
+

Removes the corresponding credentials record from the database.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

cb

callback to be called when the operation has completed.

[scope async]

user_data

user_data to pass to the callback.

 
+
+
+
+
+

signon_identity_remove_reference ()

+
void
+signon_identity_remove_reference (SignonIdentity *self,
+                                  const gchar *reference,
+                                  SignonIdentityReferenceRemovedCb cb,
+                                  gpointer user_data);
+

Removes named reference from identity. Not currently supported by gSSO.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

reference

reference to be removed

 

cb

callback

 

user_data

user_data.

 
+
+
+
+
+

signon_identity_signout ()

+
void
+signon_identity_signout (SignonIdentity *self,
+                         SignonIdentitySignedOutCb cb,
+                         gpointer user_data);
+

Asks signond to close all authentication sessions for this +identity, and to remove any stored secrets associated with it (password and +authentication tokens).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

cb

callback.

[scope async]

user_data

user_data.

 
+
+
+
+
+

signon_identity_store_credentials_with_args ()

+
void
+signon_identity_store_credentials_with_args
+                               (SignonIdentity *self,
+                                const gchar *username,
+                                const gchar *secret,
+                                const gboolean store_secret,
+                                GHashTable *methods,
+                                const gchar *caption,
+                                const gchar * const *realms,
+                                const SignonSecurityContext *owner,
+                                SignonSecurityContextList *access_control_list,
+                                SignonIdentityType type,
+                                SignonIdentityStoreCredentialsCb cb,
+                                gpointer user_data);
+

Stores the given data into the identity. See above for the meaning +of the specific fields.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

username

username.

[allow-none]

secret

secret.

[allow-none]

store_secret

whether gSSO should save the password in secret storage.

 

methods

allowed methods.

[transfer none][element-type utf8 GStrv]

caption

caption.

[allow-none]

realms

allowed realms.

[allow-none]

owner

owner.

[allow-none]

access_control_list

access control list.

[allow-none]

type

the type of the identity.

 

cb

callback.

[scope async]

user_data

user_data.

 
+
+
+
+
+

signon_identity_store_credentials_with_info ()

+
void
+signon_identity_store_credentials_with_info
+                               (SignonIdentity *self,
+                                const SignonIdentityInfo *info,
+                                SignonIdentityStoreCredentialsCb cb,
+                                gpointer user_data);
+

Stores the data contained in info + into the identity record in the database. +See above for the detailed discussion of the meaning of various fields and +their defaults.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

info

the SignonIdentityInfo data to store.

 

cb

callback.

[scope async]

user_data

user_data.

 
+
+
+
+
+

signon_identity_verify_secret ()

+
void
+signon_identity_verify_secret (SignonIdentity *self,
+                               const gchar *secret,
+                               SignonIdentityVerifyCb cb,
+                               gpointer user_data);
+

Verifies the given secret. Not currently supported by gSSO.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

self

the SignonIdentity.

 

secret

the secret (password) to be verified.

 

cb

callback.

[scope async]

user_data

user_data.

 
+
+
+
+
+

Types and Values

+
+

struct SignonIdentity

+
struct SignonIdentity;
+

Opaque struct. Use the accessor functions below.

+
+
+
+

struct SignonIdentityClass

+
struct SignonIdentityClass {
+    GObjectClass parent_class;
+};
+
+

Opaque struct. Use the accessor functions below.

+
+

Members

+
+++++ + + + + + +

GObjectClass parent_class;

reference to a parent class

 
+
+
+
+
+

SignonIdentityReferenceAddedCb

+
typedef SignonIdentityVoidCb SignonIdentityReferenceAddedCb;
+
+

Callback to be passed to signon_identity_add_reference().

+
+
+
+

SignonIdentityReferenceRemovedCb

+
typedef SignonIdentityVoidCb SignonIdentityReferenceRemovedCb;
+
+

Callback to be passed to signon_identity_remove_reference().

+
+
+
+

SignonIdentityRemovedCb

+
typedef SignonIdentityVoidCb SignonIdentityRemovedCb;
+
+

Callback to be passed to signon_identity_remove().

+
+
+
+

SignonIdentitySignedOutCb

+
typedef SignonIdentityVoidCb SignonIdentitySignedOutCb;
+
+

Callback to be passed to signon_identity_signout().

+
+
+
+

Property Details

+
+

The “app-ctx” property

+
  “app-ctx”                  gchar *
+

Set/Get Application Security Context.

+

Flags: Read / Write

+

Default value: ""

+
+
+
+

The “id” property

+
  “id”                       guint
+

Set/Get Identity ID.

+

Flags: Read / Write

+

Default value: 0

+
+
+
+

Signal Details

+
+

The “signout” signal

+
void
+user_function (SignonIdentity *arg0,
+               gpointer        user_data)
+

Emitted when the identity was signed out.

+
+

Parameters

+
+++++ + + + + + +

user_data

user data set when the signal handler was connected.

 
+
+

Flags: No Hooks

+
+
+
+ + + \ No newline at end of file diff --git a/docs/reference/html/SignonIdentityInfo.html b/docs/reference/html/SignonIdentityInfo.html index b04cf1e..0d0fb14 100644 --- a/docs/reference/html/SignonIdentityInfo.html +++ b/docs/reference/html/SignonIdentityInfo.html @@ -2,32 +2,27 @@ -SignonIdentityInfo - +libgsignon-glib Reference Manual: SignonIdentityInfo + - + - + - - - - - - - - - - + + + + + + +
@@ -35,670 +30,1036 @@

SignonIdentityInfo

SignonIdentityInfo — data contained in a SignonIdentity.

- +
-
-

Synopsis

-
                    SignonIdentityInfo;
-enum                SignonIdentityType;
-void                signon_identity_info_access_control_list_append
-                                                        (SignonIdentityInfo *info,
-                                                         SignonSecurityContext *security_context);
-SignonIdentityInfo * signon_identity_info_copy          (const SignonIdentityInfo *other);
-void                signon_identity_info_free           (SignonIdentityInfo *info);
-const SignonSecurityContextList * signon_identity_info_get_access_control_list
-                                                        (const SignonIdentityInfo *info);
-const gchar *       signon_identity_info_get_caption    (const SignonIdentityInfo *info);
-gint                signon_identity_info_get_id         (const SignonIdentityInfo *info);
-SignonIdentityType  signon_identity_info_get_identity_type
-                                                        (const SignonIdentityInfo *info);
-const GHashTable *  signon_identity_info_get_methods    (const SignonIdentityInfo *info);
-const SignonSecurityContext * signon_identity_info_get_owner
-                                                        (const SignonIdentityInfo *info);
-const gchar * const * signon_identity_info_get_realms   (const SignonIdentityInfo *info);
-gboolean            signon_identity_info_get_storing_secret
-                                                        (const SignonIdentityInfo *info);
-const gchar *       signon_identity_info_get_username   (const SignonIdentityInfo *info);
-SignonIdentityInfo * signon_identity_info_new           ();
-void                signon_identity_info_remove_method  (SignonIdentityInfo *info,
-                                                         const gchar *method);
-void                signon_identity_info_set_access_control_list
-                                                        (SignonIdentityInfo *info,
-                                                         const SignonSecurityContextList *access_control_list);
-void                signon_identity_info_set_caption    (SignonIdentityInfo *info,
-                                                         const gchar *caption);
-void                signon_identity_info_set_identity_type
-                                                        (SignonIdentityInfo *info,
-                                                         SignonIdentityType type);
-void                signon_identity_info_set_method     (SignonIdentityInfo *info,
-                                                         const gchar *method,
-                                                         const gchar * const *mechanisms);
-void                signon_identity_info_set_methods    (SignonIdentityInfo *info,
-                                                         const GHashTable *methods);
-void                signon_identity_info_set_owner      (SignonIdentityInfo *info,
-                                                         const SignonSecurityContext *owner);
-void                signon_identity_info_set_owner_from_values
-                                                        (SignonIdentityInfo *info,
-                                                         const gchar *system_context,
-                                                         const gchar *application_context);
-void                signon_identity_info_set_realms     (SignonIdentityInfo *info,
-                                                         const gchar * const *realms);
-void                signon_identity_info_set_secret     (SignonIdentityInfo *info,
-                                                         const gchar *secret,
-                                                         gboolean store_secret);
-void                signon_identity_info_set_username   (SignonIdentityInfo *info,
-                                                         const gchar *username);
-
-
-

Object Hierarchy

-
-  GBoxed
-   +----SignonIdentityInfo
-
-
-
-

Description

-

-SignonIdentityInfo represents data contained in a database record for an identity -and provides getters and setters for individual items. -

-

-See SignonIdentity for a detailed discussion -of what each item means and how and when it's used. -

-
-
-

Details

-
-

SignonIdentityInfo

-
typedef struct _SignonIdentityInfo SignonIdentityInfo;
-

-Opaque struct. Use the accessor functions below. -

-
-
-
-

enum SignonIdentityType

-
typedef enum {
-    SIGNON_IDENTITY_TYPE_OTHER = 0,
-    SIGNON_IDENTITY_TYPE_APP = 1 << 0,
-    SIGNON_IDENTITY_TYPE_WEB = 1 << 1,
-    SIGNON_IDENTITY_TYPE_NETWORK = 1 << 2
-} SignonIdentityType;
-
-

-Identity types used in SignonIdentityInfo. -

-
-+

Functions

+
++++ - - + - - + - - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

SIGNON_IDENTITY_TYPE_OTHER

an identity that is not an app, web or network + +void + +signon_identity_info_access_control_list_append ()

SIGNON_IDENTITY_TYPE_APP

an application identity + +SignonIdentityInfo * + +signon_identity_info_copy ()

SIGNON_IDENTITY_TYPE_WEB

a web identity + +void + +signon_identity_info_free ()

SIGNON_IDENTITY_TYPE_NETWORK

a network server identity + +SignonSecurityContextList * + +signon_identity_info_get_access_control_list () +
const gchar * + +signon_identity_info_get_caption () +
+gint + +signon_identity_info_get_id () +
+SignonIdentityType + +signon_identity_info_get_identity_type () +
+GHashTable * + +signon_identity_info_get_methods () +
const SignonSecurityContext * + +signon_identity_info_get_owner () +
const gchar * const * + +signon_identity_info_get_realms () +
+gboolean + +signon_identity_info_get_storing_secret () +
const gchar * + +signon_identity_info_get_username () +
+SignonIdentityInfo * + +signon_identity_info_new () +
+void + +signon_identity_info_own_methods () +
+void + +signon_identity_info_remove_method () +
+void + +signon_identity_info_set_access_control_list () +
+void + +signon_identity_info_set_caption () +
+void + +signon_identity_info_set_identity_type () +
+void + +signon_identity_info_set_method () +
+void + +signon_identity_info_set_methods () +
+void + +signon_identity_info_set_owner () +
+void + +signon_identity_info_set_owner_from_values () +
+void + +signon_identity_info_set_realms () +
+void + +signon_identity_info_set_secret () +
+void + +signon_identity_info_set_username ()
-
-
-

signon_identity_info_access_control_list_append ()

-
void                signon_identity_info_access_control_list_append
-                                                        (SignonIdentityInfo *info,
-                                                         SignonSecurityContext *security_context);
-

-Appends a new SignonSecurityContext item to the access control list. -

-
-+
+

Types and Values

+
++++ - - + + - - + +

info :

the SignonIdentityInfo. SignonIdentityInfo

security_context :

a security context to be appended. [transfer full] -enumSignonIdentityType
-
+
+

Object Hierarchy

+
    GBoxed
+    ╰── SignonIdentityInfo
+
+
+
+

Description

+

SignonIdentityInfo represents data contained in a database record for an identity +and provides getters and setters for individual items.

+

See SignonIdentity for a detailed discussion +of what each item means and how and when it's used.

+
+
+

Functions

-

signon_identity_info_copy ()

-
SignonIdentityInfo * signon_identity_info_copy          (const SignonIdentityInfo *other);
-

-Get a newly-allocated copy of info. -

-
-+

signon_identity_info_access_control_list_append ()

+
void
+signon_identity_info_access_control_list_append
+                               (SignonIdentityInfo *info,
+                                SignonSecurityContext *security_context);
+

Appends a new SignonSecurityContext item to the access control list.

+
+

Parameters

+
+++++ - - + + + - - + + +

other :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

Returns :

a copy of the given SignonIdentityInfo, or NULL on failure.

security_context

a security context to be appended.

[transfer full]
+

-

signon_identity_info_free ()

-
void                signon_identity_info_free           (SignonIdentityInfo *info);
-

-Destroys the given SignonIdentityInfo item. -

-
-+

signon_identity_info_copy ()

+
SignonIdentityInfo *
+signon_identity_info_copy (const SignonIdentityInfo *other);
+

Get a newly-allocated copy of info +.

+
+

Parameters

+
+++++ - - + + +

info :

the SignonIdentityInfo.

other

the SignonIdentityInfo.

 
+
+

Returns

+

a copy of the given SignonIdentityInfo, or NULL on failure.

+

+
+

-

signon_identity_info_get_access_control_list ()

-
const SignonSecurityContextList * signon_identity_info_get_access_control_list
-                                                        (const SignonIdentityInfo *info);
-

-Get an access control list associated with an identity. -

-
-- - - - - - - - - - +

signon_identity_info_free ()

+
void
+signon_identity_info_free (SignonIdentityInfo *info);
+

Destroys the given SignonIdentityInfo item.

+
+

Parameters

+

info :

the SignonIdentityInfo.

Returns :

a list of ACL security contexts. [transfer none] -
+++++ + + + + +

info

the SignonIdentityInfo.

 
+

-

signon_identity_info_get_caption ()

-
const gchar *       signon_identity_info_get_caption    (const SignonIdentityInfo *info);
-

-Get the display name of info. -

-
-- - - - - - - - - - +

signon_identity_info_get_access_control_list ()

+
SignonSecurityContextList *
+signon_identity_info_get_access_control_list
+                               (const SignonIdentityInfo *info);
+

Get an access control list associated with an identity.

+
+

Parameters

+

info :

the SignonIdentityInfo.

Returns :

the display name for the identity.
+++++ + + + + +

info

the SignonIdentityInfo.

 
+
+

Returns

+

a list of ACL security contexts.

+

[transfer none]

+
+
-

signon_identity_info_get_id ()

-
gint                signon_identity_info_get_id         (const SignonIdentityInfo *info);
-

-Get the numeric identity ID of info. -

-
-- - - - - - - - - - +

signon_identity_info_get_caption ()

+
const gchar *
+signon_identity_info_get_caption (const SignonIdentityInfo *info);
+

Get the display name of info +.

+
+

Parameters

+

info :

the SignonIdentityInfo.

Returns :

the numeric ID of the identity.
+++++ + + + + +

info

the SignonIdentityInfo.

 
+
+

Returns

+

the display name for the identity.

+

+
+
-

signon_identity_info_get_identity_type ()

-
SignonIdentityType  signon_identity_info_get_identity_type
-                                                        (const SignonIdentityInfo *info);
-

-Get the type of the identity. -

-
-- - - - - - - - - - +

signon_identity_info_get_id ()

+
gint
+signon_identity_info_get_id (const SignonIdentityInfo *info);
+

Get the numeric identity ID of info +.

+
+

Parameters

+

info :

the SignonIdentityInfo.

Returns :

the type of the identity.
+++++ + + + + +

info

the SignonIdentityInfo.

 
+
+

Returns

+

the numeric ID of the identity.

+

+
+
-

signon_identity_info_get_methods ()

-
const GHashTable *  signon_identity_info_get_methods    (const SignonIdentityInfo *info);
-

-Get a hash table of the methods and mechanisms of info. See -signon_identity_info_set_methods(). -

-
-- - - - - - - - - - +

signon_identity_info_get_identity_type ()

+
SignonIdentityType
+signon_identity_info_get_identity_type
+                               (const SignonIdentityInfo *info);
+

Get the type of the identity.

+
+

Parameters

+

info :

the SignonIdentityInfo.

Returns :

(element-type utf8 GStrv): the table of allowed -methods and mechanisms. [transfer none] -
+++++ + + + + +

info

the SignonIdentityInfo.

 
+
+

Returns

+

the type of the identity.

+

+
+
-

signon_identity_info_get_owner ()

-
const SignonSecurityContext * signon_identity_info_get_owner
-                                                        (const SignonIdentityInfo *info);
-

-Get identity owner's security context. -

-
-- - - - - - - - - - +

signon_identity_info_get_methods ()

+
GHashTable *
+signon_identity_info_get_methods (const SignonIdentityInfo *info);
+

Get a hash table of the methods and mechanisms of info +. See +signon_identity_info_set_methods().

+
+

Parameters

+

info :

the SignonIdentityInfo.

Returns :

a security context. [transfer none] -
+++++ + + + + +

info

the SignonIdentityInfo.

 
+
+

Returns

+

(element-type utf8 GStrv): the table of allowed +methods and mechanisms.

+

[transfer none]

+
+ +
+
+

signon_identity_info_get_owner ()

+
const SignonSecurityContext *
+signon_identity_info_get_owner (const SignonIdentityInfo *info);
+

Get identity owner's security context.

+
+

Parameters

+
+++++ + + + + + +

info

the SignonIdentityInfo.

 
+
+
+

Returns

+

a security context.

+

[transfer none]

+
+
+
+
+

signon_identity_info_get_realms ()

+
const gchar * const *
+signon_identity_info_get_realms (const SignonIdentityInfo *info);
+

Get an array of the allowed realms of info +.

+
+

Parameters

+
+++++ + + + + + +

info

the SignonIdentityInfo.

 
+
+
+

Returns

+

a NULL terminated array of realms.

+

[transfer none]

+
+

-

signon_identity_info_get_realms ()

-
const gchar * const * signon_identity_info_get_realms   (const SignonIdentityInfo *info);
-

-Get an array of the realms of info. -

-
-+

signon_identity_info_get_storing_secret ()

+
gboolean
+signon_identity_info_get_storing_secret
+                               (const SignonIdentityInfo *info);
+

Get whether the secret of info + should be stored by gSSO in the secret database.

+
+

Parameters

+
+++++ + + + + + +

info

the SignonIdentityInfo.

 
+
+
+

Returns

+

TRUE if gSSO must store the secret, FALSE otherwise.

+

+
+ +
+
+

signon_identity_info_get_username ()

+
const gchar *
+signon_identity_info_get_username (const SignonIdentityInfo *info);
+

Get the username associated with an identity.

+
+

Parameters

+
+++++ + + + + + +

info

the SignonIdentityInfo.

 
+
+
+

Returns

+

the username, or NULL.

+

+
+
+
+
+

signon_identity_info_new ()

+
SignonIdentityInfo *
+signon_identity_info_new ();
+

Creates a new SignonIdentityInfo item.

+
+

Returns

+

a new SignonIdentityInfo item.

+

+
+
+
+
+

signon_identity_info_own_methods ()

+
void
+signon_identity_info_own_methods (SignonIdentityInfo *info,
+                                  GHashTable *methods);
+

Set authentication methods that are allowed to be used with this identity.

+

This function will just increment reference count of hash table, so +it should be constructed with g_hash_table_new_full.

+
+

Parameters

+
+++++ - - + + + - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

Returns :

a NULL terminated array of realms. [transfer none] -

methods

(element-type utf8 GStrv): methods.

[transfer none]
+

-

signon_identity_info_get_storing_secret ()

-
gboolean            signon_identity_info_get_storing_secret
-                                                        (const SignonIdentityInfo *info);
-

-Get whether the secret of info should be stored by gSSO in the secret database. -

-
-+

signon_identity_info_remove_method ()

+
void
+signon_identity_info_remove_method (SignonIdentityInfo *info,
+                                    const gchar *method);
+

Remove method + from the list of allowed authentication methods.

+
+

Parameters

+
+++++ - - + + + - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

Returns :

-TRUE if gSSO must store the secret, FALSE otherwise.

method

an authentication method.

 
+
-

signon_identity_info_get_username ()

-
const gchar *       signon_identity_info_get_username   (const SignonIdentityInfo *info);
-

-Get the username associated with an identity. -

-
-+

signon_identity_info_set_access_control_list ()

+
void
+signon_identity_info_set_access_control_list
+                               (SignonIdentityInfo *info,
+                                SignonSecurityContextList *access_control_list);
+

Set an access control list associated with an identity.

+
+

Parameters

+
+++++ - - + + + - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

Returns :

the username, or NULL.

access_control_list

a list of ACL security contexts.

[transfer none]
-
-
-

signon_identity_info_new ()

-
SignonIdentityInfo * signon_identity_info_new           ();
-

-Creates a new SignonIdentityInfo item. -

-
-- - - - -

Returns :

a new SignonIdentityInfo item.

-

signon_identity_info_remove_method ()

-
void                signon_identity_info_remove_method  (SignonIdentityInfo *info,
-                                                         const gchar *method);
-

-Remove method from the list of allowed authentication methods. -

-
-+

signon_identity_info_set_caption ()

+
void
+signon_identity_info_set_caption (SignonIdentityInfo *info,
+                                  const gchar *caption);
+

Sets the caption (display name) for the identity.

+
+

Parameters

+
+++++ - - + + + - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

method :

an authentication method.

caption

the caption.

 
+
-

signon_identity_info_set_access_control_list ()

-
void                signon_identity_info_set_access_control_list
-                                                        (SignonIdentityInfo *info,
-                                                         const SignonSecurityContextList *access_control_list);
-

-Set an access control list associated with an identity. -

-
-+

signon_identity_info_set_identity_type ()

+
void
+signon_identity_info_set_identity_type
+                               (SignonIdentityInfo *info,
+                                SignonIdentityType type);
+

Specifies the type of this identity.

+
+

Parameters

+
+++++ - - + + + - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

access_control_list :

a list of ACL security contexts. [transfer none] -

type

the type of the identity.

 
+
-

signon_identity_info_set_caption ()

-
void                signon_identity_info_set_caption    (SignonIdentityInfo *info,
-                                                         const gchar *caption);
-

-Sets the caption (display name) for the identity. -

-
-+

signon_identity_info_set_method ()

+
void
+signon_identity_info_set_method (SignonIdentityInfo *info,
+                                 const gchar *method,
+                                 const gchar * const *mechanisms);
+

Adds a method to the list of allowed authentication methods.

+
+

Parameters

+
+++++ - - + + + + + + + + - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

method

an authentication method.

 

caption :

the caption.

mechanisms

a NULL-terminated list of mechanisms.

 
+
-

signon_identity_info_set_identity_type ()

-
void                signon_identity_info_set_identity_type
-                                                        (SignonIdentityInfo *info,
-                                                         SignonIdentityType type);
-

-Specifies the type of this identity. -

-
-+

signon_identity_info_set_methods ()

+
void
+signon_identity_info_set_methods (SignonIdentityInfo *info,
+                                  GHashTable *methods);
+

Set authentication methods that are allowed to be used with this identity.

+
+

Parameters

+
+++++ - - + + + - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

type :

the type of the identity.

methods

(element-type utf8 GStrv): methods.

[transfer none]
+
-

signon_identity_info_set_method ()

-
void                signon_identity_info_set_method     (SignonIdentityInfo *info,
-                                                         const gchar *method,
-                                                         const gchar * const *mechanisms);
-

-Adds a method to the list of allowed authentication methods. -

-
-+

signon_identity_info_set_owner ()

+
void
+signon_identity_info_set_owner (SignonIdentityInfo *info,
+                                const SignonSecurityContext *owner);
+

Set identity owner's security context.

+
+

Parameters

+
+++++ - - + + + - - - - - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

method :

an authentication method.

mechanisms :

a NULL-terminated list of mechanisms.

owner

a security context of owner.

[transfer none]
+
-

signon_identity_info_set_methods ()

-
void                signon_identity_info_set_methods    (SignonIdentityInfo *info,
-                                                         const GHashTable *methods);
-

-Set authentication methods that are allowed to be used with this identity. -

-
-+

signon_identity_info_set_owner_from_values ()

+
void
+signon_identity_info_set_owner_from_values
+                               (SignonIdentityInfo *info,
+                                const gchar *system_context,
+                                const gchar *application_context);
+

Set identity owner's security context.

+
+

Parameters

+
+++++ - - + + + - - + + + + + + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

methods :

(element-type utf8 GStrv): methods. [transfer none] -

system_context

owner's system context.

 

application_context

owner's application context.

 
+
-

signon_identity_info_set_owner ()

-
void                signon_identity_info_set_owner      (SignonIdentityInfo *info,
-                                                         const SignonSecurityContext *owner);
-

-Set identity owner's security context. -

-
-+

signon_identity_info_set_realms ()

+
void
+signon_identity_info_set_realms (SignonIdentityInfo *info,
+                                 const gchar * const *realms);
+

Specify what realms this identity can be used in.

+
+

Parameters

+
+++++ - - + + + - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

owner :

a security context of owner. [transfer none] -

realms

a NULL-terminated list of realms.

 
+
-

signon_identity_info_set_owner_from_values ()

-
void                signon_identity_info_set_owner_from_values
-                                                        (SignonIdentityInfo *info,
-                                                         const gchar *system_context,
-                                                         const gchar *application_context);
-

-Set identity owner's security context. -

-
-+

signon_identity_info_set_secret ()

+
void
+signon_identity_info_set_secret (SignonIdentityInfo *info,
+                                 const gchar *secret,
+                                 gboolean store_secret);
+

Sets the secret (password) for the identity, and whether the gSSO daemon +should remember it.

+
+

Parameters

+
+++++ - - + + + - - + + + - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

system_context :

owner's system context.

secret

the secret.

 

application_context :

owner's application context.

store_secret

whether signond should store the secret in its DB.

 
+
-

signon_identity_info_set_realms ()

-
void                signon_identity_info_set_realms     (SignonIdentityInfo *info,
-                                                         const gchar * const *realms);
-

-Specify what realms this identity can be used in. -

-
-+

signon_identity_info_set_username ()

+
void
+signon_identity_info_set_username (SignonIdentityInfo *info,
+                                   const gchar *username);
+

Sets the username for the identity.

+
+

Parameters

+
+++++ - - + + + - - + + +

info :

the SignonIdentityInfo.

info

the SignonIdentityInfo.

 

realms :

a NULL-terminated list of realms.

username

the username.

 
+ + +
+

Types and Values

+
+

SignonIdentityInfo

+
typedef struct _SignonIdentityInfo SignonIdentityInfo;
+

Opaque struct. Use the accessor functions below.

+

-

signon_identity_info_set_secret ()

-
void                signon_identity_info_set_secret     (SignonIdentityInfo *info,
-                                                         const gchar *secret,
-                                                         gboolean store_secret);
-

-Sets the secret (password) for the identity, and whether the gSSO daemon -should remember it. -

-
-+

enum SignonIdentityType

+

Identity types used in SignonIdentityInfo.

+
+

Members

+
+++++ - - - - - - + + + - - + + + - -

info :

the SignonIdentityInfo.

secret :

the secret.

SIGNON_IDENTITY_TYPE_OTHER

+

an identity that is not an app, web or network

+
 

store_secret :

whether signond should store the secret in its DB.

SIGNON_IDENTITY_TYPE_APP

+

an application identity

+
 
-
-
-
-

signon_identity_info_set_username ()

-
void                signon_identity_info_set_username   (SignonIdentityInfo *info,
-                                                         const gchar *username);
-

-Sets the username for the identity. -

-
-- - - + + + - - + + +

info :

the SignonIdentityInfo.

SIGNON_IDENTITY_TYPE_WEB

+

a web identity

+
 

username :

the username.

SIGNON_IDENTITY_TYPE_NETWORK

+

a network server identity

+
 
+ + Generated by GTK-Doc V1.20 \ No newline at end of file diff --git a/docs/reference/html/SignonSecurityContext.html b/docs/reference/html/SignonSecurityContext.html index d980fda..0ae4066 100644 --- a/docs/reference/html/SignonSecurityContext.html +++ b/docs/reference/html/SignonSecurityContext.html @@ -2,32 +2,27 @@ -SignonSecurityContext - +libgsignon-glib Reference Manual: SignonSecurityContext + - + - - - - - - - - - - + + + + + + +
@@ -35,450 +30,609 @@

SignonSecurityContext

SignonSecurityContext — representation of a security context.

- +
-
-

Synopsis

-
struct              SignonSecurityContext;
-typedef             SignonSecurityContextList;
-GVariant *          signon_security_context_build_variant
-                                                        (const SignonSecurityContext *ctx);
-SignonSecurityContext * signon_security_context_copy    (const SignonSecurityContext *src_ctx);
-SignonSecurityContext * signon_security_context_deconstruct_variant
-                                                        (GVariant *variant);
-void                signon_security_context_free        (SignonSecurityContext *ctx);
-const gchar *       signon_security_context_get_application_context
-                                                        (const SignonSecurityContext *ctx);
-const gchar *       signon_security_context_get_system_context
-                                                        (const SignonSecurityContext *ctx);
-GVariant *          signon_security_context_list_build_variant
-                                                        (const SignonSecurityContextList *list);
-SignonSecurityContextList * signon_security_context_list_copy
-                                                        (const SignonSecurityContextList *src_list);
-SignonSecurityContextList * signon_security_context_list_deconstruct_variant
-                                                        (GVariant *variant);
-void                signon_security_context_list_free   (SignonSecurityContextList *seclist);
-SignonSecurityContext * signon_security_context_new     ();
-SignonSecurityContext * signon_security_context_new_from_values
-                                                        (const gchar *system_context,
-                                                         const gchar *application_context);
-void                signon_security_context_set_application_context
-                                                        (SignonSecurityContext *ctx,
-                                                         const gchar *application_context);
-void                signon_security_context_set_system_context
-                                                        (SignonSecurityContext *ctx,
-                                                         const gchar *system_context);
-
+ +
+

Types and Values

+
++++ + + + + + + + + + + +
structSignonSecurityContext
typedefSignonSecurityContextList

Object Hierarchy

-
-  GBoxed
-   +----SignonSecurityContext
+
    GBoxed
+    ╰── SignonSecurityContext
 

Description

-

-The SignonSecurityContext represents a security context within -system and also within application. Security contexts are used: -

-

-

-
    +

    The SignonSecurityContext represents a security context within +system and also within application. Security contexts are used:

    +
    • within identities to specify the owner of the identity, and -users of the identity (items on the access control list). See SignonIdentity.

    • +users of the identity (items on the access control list). See SignonIdentity.

    • by gSSO daemon to identify the application accessing the gSSO service and to determine if the application is an identity's owner, or is on the identity's access control list, and make access control decisions accordingly.

    -

    -

    -

    -SignonSecurityContext contains two strings: a system context and an -application context. -

    -

    -System context can be a binary path, SMACK-label, or MSSF token. Specific +

    SignonSecurityContext contains two strings: a system context and an +application context.

    +

    System context can be a binary path, SMACK-label, or MSSF token. Specific interpretation of the system context value is performed by a gSSO extension module. -The default gSSO extension expects binary paths. -

    -

    -Application context identifies a script or a webpage within an application, +The default gSSO extension expects binary paths.

    +

    Application context identifies a script or a webpage within an application, and it's used for providing access control to runtime environments (when making an access control decision requires not only a binary identifier, but also information -about what the binary is doing). -

    -

    -System context and application context can contain a wildcard +about what the binary is doing).

    +

    System context and application context can contain a wildcard operator "*" to match 'any', while "" matches 'none' when a default gSSO extension is used. The system context is always evaluated first and if a match is found, only then the application context is evaluated. Check the documentation of a platform specific extension to determine -any particular match rules used by a custom ACM (Access Control Manager). -

    +any particular match rules used by a custom ACM (Access Control Manager).

-

Details

+

Functions

-

struct SignonSecurityContext

-
struct SignonSecurityContext {
-    gchar *sys_ctx;
-    gchar *app_ctx;
-};
-
-

-Security context descriptor used for access control checks. -

-
-- - - - - - - - - - +

signon_security_context_build_variant ()

+
GVariant *
+signon_security_context_build_variant (const SignonSecurityContext *ctx);
+

Build a GVariant of type "(ss)" from a SignonSecurityContext item.

+
+

Parameters

+

gchar *sys_ctx;

system context, such as SMACK-label, MSSF token or just a -binary path.

gchar *app_ctx;

application context, such as a script or a web page.
+++++ + + + + +

ctx

SignonSecurityContext item.

 
+
+

Returns

+

GVariant construct of a SignonSecurityContext.

+

[transfer full]

+
+

-

SignonSecurityContextList

-
typedef GList SignonSecurityContextList;
-
-

-GList of SignonSecurityContext items. -

+

signon_security_context_copy ()

+
SignonSecurityContext *
+signon_security_context_copy (const SignonSecurityContext *src_ctx);
+

Copy a security context item.

+
+

Parameters

+
+++++ + + + + + +

src_ctx

source security context to copy.

 
+
+
+

Returns

+

a copy of the SignonSecurityContext item.

+

[transfer full]

+

-

signon_security_context_build_variant ()

-
GVariant *          signon_security_context_build_variant
-                                                        (const SignonSecurityContext *ctx);
-

-Build a GVariant of type "(ss)" from a SignonSecurityContext item. -

-
-- - - - - - - - - - +

signon_security_context_deconstruct_variant ()

+
SignonSecurityContext *
+signon_security_context_deconstruct_variant
+                               (GVariant *variant);
+

Builds a SignonSecurityContext item from a GVariant of type "(ss)".

+
+

Parameters

+

ctx :

-SignonSecurityContext item.

Returns :

GVariant construct of a SignonSecurityContext. [transfer full] -
+++++ + + + + +

variant

GVariant item with a SignonSecurityContext construct.

 
+
+

Returns

+

SignonSecurityContext item.

+

[transfer full]

+
+

-

signon_security_context_copy ()

-
SignonSecurityContext * signon_security_context_copy    (const SignonSecurityContext *src_ctx);
-

-Copy a security context item. -

-
-- - - - - - - - - - +

signon_security_context_free ()

+
void
+signon_security_context_free (SignonSecurityContext *ctx);
+

Frees a security context item.

+
+

Parameters

+

src_ctx :

source security context to copy.

Returns :

a copy of the SignonSecurityContext item. [transfer full] -
+++++ + + + + +

ctx

SignonSecurityContext to be freed.

 
+

-

signon_security_context_deconstruct_variant ()

-
SignonSecurityContext * signon_security_context_deconstruct_variant
-                                                        (GVariant *variant);
-

-Builds a SignonSecurityContext item from a GVariant of type "(ss)". -

-
-- - - - - - - - - - +

signon_security_context_get_application_context ()

+
const gchar *
+signon_security_context_get_application_context
+                               (const SignonSecurityContext *ctx);
+

Get the application context part (such as script name or a web page) of +the SignonSecurityContext.

+
+

Parameters

+

variant :

GVariant item with a SignonSecurityContext construct.

Returns :

-SignonSecurityContext item. [transfer full] -
+++++ + + + + +

ctx

SignonSecurityContext item.

 
+
+

Returns

+

application context.

+

[transfer none]

+
+

-

signon_security_context_free ()

-
void                signon_security_context_free        (SignonSecurityContext *ctx);
-

-Frees a security context item. -

-
-+

signon_security_context_get_system_context ()

+
const gchar *
+signon_security_context_get_system_context
+                               (const SignonSecurityContext *ctx);
+

Get the system context part (such as SMACK label or MSSF token) of the +SignonSecurityContext.

+
+

Parameters

+
+++++ - - + + +

ctx :

-SignonSecurityContext to be freed.

ctx

SignonSecurityContext item.

 
+
+

Returns

+

system context.

+

[transfer none]

+
+
-

signon_security_context_get_application_context ()

-
const gchar *       signon_security_context_get_application_context
-                                                        (const SignonSecurityContext *ctx);
-

-Get the application context part (such as script name or a web page) of -the SignonSecurityContext. -

-
-- - - - - - - - - - +

signon_security_context_list_build_variant ()

+
GVariant *
+signon_security_context_list_build_variant
+                               (const SignonSecurityContextList *list);
+

Builds a GVariant of type "a(ss)" from a GList of SignonSecurityContext +items.

+
+

Parameters

+

ctx :

-SignonSecurityContext item.

Returns :

application context. [transfer none] -
+++++ + + + + +

list

SignonSecurityContextList item.

 
+
+

Returns

+

GVariant construct of a SignonSecurityContextList.

+

[transfer full]

+
+
-

signon_security_context_get_system_context ()

-
const gchar *       signon_security_context_get_system_context
-                                                        (const SignonSecurityContext *ctx);
-

-Get the system context part (such as SMACK label or MSSF token) of the -SignonSecurityContext. -

-
-- - - - - - - - - - +

signon_security_context_list_copy ()

+
SignonSecurityContextList *
+signon_security_context_list_copy (const SignonSecurityContextList *src_list);
+

Copies a GList of SignonSecurityContext items.

+
+

Parameters

+

ctx :

-SignonSecurityContext item.

Returns :

system context. [transfer none] -
+++++ + + + + +

src_list

source SignonSecurityContextList.

 
+
+

Returns

+

SignonSecurityContextList item.

+

[transfer full]

+
+
-

signon_security_context_list_build_variant ()

-
GVariant *          signon_security_context_list_build_variant
-                                                        (const SignonSecurityContextList *list);
-

-Builds a GVariant of type "a(ss)" from a GList of SignonSecurityContext -items. -

-
-- - - - - - - - - - +

signon_security_context_list_deconstruct_variant ()

+
SignonSecurityContextList *
+signon_security_context_list_deconstruct_variant
+                               (GVariant *variant);
+

Builds a GList of SignonSecurityContext items from a GVariant of type +"a(ss)".

+
+

Parameters

+

list :

-SignonSecurityContextList item.

Returns :

GVariant construct of a SignonSecurityContextList. [transfer full] -
+++++ + + + + +

variant

GVariant item with a list of security context tuples.

 
+
+

Returns

+

SignonSecurityContextList item.

+

[transfer full]

+
+
-

signon_security_context_list_copy ()

-
SignonSecurityContextList * signon_security_context_list_copy
-                                                        (const SignonSecurityContextList *src_list);
-

-Copies a GList of SignonSecurityContext items. -

-
-- - - - - - - - - - +

signon_security_context_list_free ()

+
void
+signon_security_context_list_free (SignonSecurityContextList *seclist);
+

Frees all items and the GList of SignonSecurityContext.

+
+

Parameters

+

src_list :

source SignonSecurityContextList.

Returns :

-SignonSecurityContextList item. [transfer full] -
+++++ + + + + +

seclist

SignonSecurityContextList item.

[transfer full]
+
-

signon_security_context_list_deconstruct_variant ()

-
SignonSecurityContextList * signon_security_context_list_deconstruct_variant
-                                                        (GVariant *variant);
-

-Builds a GList of SignonSecurityContext items from a GVariant of type -"a(ss)". -

-
-+

signon_security_context_new ()

+
SignonSecurityContext *
+signon_security_context_new ();
+

Allocates a new security context item.

+
+

Returns

+

allocated SignonSecurityContext.

+

[transfer full]

+
+ +
+
+

signon_security_context_new_from_values ()

+
SignonSecurityContext *
+signon_security_context_new_from_values
+                               (const gchar *system_context,
+                                const gchar *application_context);
+

Allocates and initializes a new security context item.

+
+

Parameters

+
+++++ - - + + + - - + + +

variant :

GVariant item with a list of security context tuples.

system_context

system security context (such as SMACK/MSSF label/token).

 

Returns :

-SignonSecurityContextList item. [transfer full] -

application_context

application security context (such as a script name).

 
-
-
-

signon_security_context_list_free ()

-
void                signon_security_context_list_free   (SignonSecurityContextList *seclist);
-

-Frees all items and the GList of SignonSecurityContext. -

-
-- - - - -

seclist :

-SignonSecurityContextList item. [transfer full] -
+
+

Returns

+

allocated SignonSecurityContext.

+

[transfer full]

-
-
-

signon_security_context_new ()

-
SignonSecurityContext * signon_security_context_new     ();
-

-Allocates a new security context item. -

-
-- - - - -

Returns :

allocated SignonSecurityContext. [transfer full] -

-

signon_security_context_new_from_values ()

-
SignonSecurityContext * signon_security_context_new_from_values
-                                                        (const gchar *system_context,
-                                                         const gchar *application_context);
-

-Allocates and initializes a new security context item. -

-
-+

signon_security_context_set_application_context ()

+
void
+signon_security_context_set_application_context
+                               (SignonSecurityContext *ctx,
+                                const gchar *application_context);
+

Sets the application context part (such as a script name or a web page) of +the SignonSecurityContext.

+
+

Parameters

+
+++++ - - + + + - - - - - - + + +

system_context :

system security context (such as SMACK/MSSF label/token).

ctx

SignonSecurityContext item.

 

application_context :

application security context (such as a script name).

Returns :

allocated SignonSecurityContext. [transfer full] -

application_context

application security context.

 
+

-

signon_security_context_set_application_context ()

-
void                signon_security_context_set_application_context
-                                                        (SignonSecurityContext *ctx,
-                                                         const gchar *application_context);
-

-Sets the application context part (such as a script name or a web page) of -the SignonSecurityContext. -

-
-+

signon_security_context_set_system_context ()

+
void
+signon_security_context_set_system_context
+                               (SignonSecurityContext *ctx,
+                                const gchar *system_context);
+

Sets the system context part (such as SMACK label or MSSF token) of the +SignonSecurityContext.

+
+

Parameters

+
+++++ - - + + + - - + + +

ctx :

-SignonSecurityContext item.

ctx

SignonSecurityContext item.

 

application_context :

application security context.

system_context

system security context.

 
-
+ + +
+

Types and Values

-

signon_security_context_set_system_context ()

-
void                signon_security_context_set_system_context
-                                                        (SignonSecurityContext *ctx,
-                                                         const gchar *system_context);
-

-Sets the system context part (such as SMACK label or MSSF token) of the -SignonSecurityContext. -

-
-+

struct SignonSecurityContext

+
struct SignonSecurityContext {
+    gchar *sys_ctx;
+    gchar *app_ctx;
+};
+
+

Security context descriptor used for access control checks.

+
+

Members

+
+++++ - - + + + - - + + +

ctx :

-SignonSecurityContext item.

gchar *sys_ctx;

system context, such as SMACK-label, MSSF token or just a +binary path.

 

system_context :

system security context.

gchar *app_ctx;

application context, such as a script or a web page.

 
+
+
+

SignonSecurityContextList

+
typedef GList SignonSecurityContextList;
+
+

GList of SignonSecurityContext items.

+
+ + Generated by GTK-Doc V1.20 \ No newline at end of file diff --git a/docs/reference/html/annotation-glossary.html b/docs/reference/html/annotation-glossary.html index e6044a1..ac36f87 100644 --- a/docs/reference/html/annotation-glossary.html +++ b/docs/reference/html/annotation-glossary.html @@ -2,61 +2,50 @@ -Annotation Glossary - +libgsignon-glib Reference Manual: Annotation Glossary + - + - - - - - - - - - - + + + + + + +

Annotation Glossary

A

-
-allow-none
-

NULL is ok, both for passing and for returning.

-

S

-
-scope async
-

The callback is valid until first called.

+
allow-none
+

NULL is ok, both for passing and for returning.

E

-
-element-type
-

Generics and defining elements of containers and arrays.

+
element-type
+

Generics and defining elements of containers and arrays.

+

S

+
scope async
+

The callback is valid until first called.

T

-
-transfer full
-

Free data after the code is done.

-
-type
-

Override the parsed C type with given type

-
-transfer none
-

Don't free data after the code is done.

+
transfer full
+

Free data after the code is done.

+
transfer none
+

Don't free data after the code is done.

+
type
+

Override the parsed C type with given type.

+ Generated by GTK-Doc V1.20 \ No newline at end of file diff --git a/docs/reference/html/api-index-1-8.html b/docs/reference/html/api-index-1-8.html index de0e9bb..0e26b57 100644 --- a/docs/reference/html/api-index-1-8.html +++ b/docs/reference/html/api-index-1-8.html @@ -2,41 +2,38 @@ -Index of new symbols in 1.8 - +libgsignon-glib Reference Manual: Index of new symbols in 1.8 + - + - - - - - - - - - - + + + + + + + + Generated by GTK-Doc V1.20 \ No newline at end of file diff --git a/docs/reference/html/api-index-deprecated.html b/docs/reference/html/api-index-deprecated.html index 07b2829..c5ffbdc 100644 --- a/docs/reference/html/api-index-deprecated.html +++ b/docs/reference/html/api-index-deprecated.html @@ -2,41 +2,38 @@ -Index of deprecated symbols - +libgsignon-glib Reference Manual: Index of deprecated symbols + - + - - - - - - - - - - + + + + + + + + Generated by GTK-Doc V1.20 \ No newline at end of file diff --git a/docs/reference/html/api-index-full.html b/docs/reference/html/api-index-full.html index 140fa9d..87c5905 100644 --- a/docs/reference/html/api-index-full.html +++ b/docs/reference/html/api-index-full.html @@ -2,42 +2,41 @@ -API Index - +libgsignon-glib Reference Manual: API Index + - + - - - - - - - - - - + + + + + + +

API Index

A

-SignonAuthServiceClass, struct in SignonAuthService +SignonAuthService, struct in SignonAuthService +
+
+
+SignonAuthServiceClass, struct in SignonAuthService
@@ -45,11 +44,11 @@
-SignonAuthSession::state-changed, object signal in SignonAuthSession +SignonAuthSession::state-changed, object signal in SignonAuthSession
-SignonAuthSession:identity, object property in SignonAuthSession +SignonAuthSession:identity, object property in SignonAuthSession
@@ -57,55 +56,59 @@
-SignonAuthSessionProcessCb, user_function in SignonAuthSession +SignonAuthSessionProcessCb, user_function in SignonAuthSession
-SignonAuthSessionQueryAvailableMechanismsCb, user_function in SignonAuthSession +SignonAuthSessionQueryAvailableMechanismsCb, user_function in SignonAuthSession
-signon_auth_service_new, function in SignonAuthService +signon_auth_service_new, function in SignonAuthService
-signon_auth_service_query_identities, function in SignonAuthService +signon_auth_service_query_identities, function in SignonAuthService
-signon_auth_service_query_mechanisms, function in SignonAuthService +signon_auth_service_query_mechanisms, function in SignonAuthService
-signon_auth_service_query_methods, function in SignonAuthService +signon_auth_service_query_methods, function in SignonAuthService
-signon_auth_session_cancel, function in SignonAuthSession +signon_auth_session_cancel, function in SignonAuthSession
-signon_auth_session_get_method, function in SignonAuthSession +signon_auth_session_get_method, function in SignonAuthSession
-signon_auth_session_new, function in SignonAuthSession +signon_auth_session_new, function in SignonAuthSession
-signon_auth_session_process, function in SignonAuthSession +signon_auth_session_new_for_identity, function in SignonAuthSession
-signon_auth_session_process_async, function in SignonAuthSession +signon_auth_session_process, function in SignonAuthSession
-signon_auth_session_process_finish, function in SignonAuthSession +signon_auth_session_process_async, function in SignonAuthSession
-signon_auth_session_query_available_mechanisms, function in SignonAuthSession +signon_auth_session_process_finish, function in SignonAuthSession +
+
+
+signon_auth_session_query_available_mechanisms, function in SignonAuthSession

E

@@ -118,16 +121,32 @@
-signon_error_quark, function in SignonError +signon_error_quark, function in SignonError

I

-SignonIdentityClass, struct in SignonIdentity +SignonIdentity, struct in SignonIdentity +
+
+
+SignonIdentity::signout, object signal in SignonIdentity
-SignonIdentityFilter, typedef in SignonAuthService +SignonIdentity:app-ctx, object property in SignonIdentity +
+
+
+SignonIdentity:id, object property in SignonIdentity +
+
+
+SignonIdentityClass, struct in SignonIdentity +
+
+
+SignonIdentityFilter, typedef in SignonAuthService
@@ -135,35 +154,35 @@
-SignonIdentityInfoCb, user_function in SignonIdentity +SignonIdentityInfoCb, user_function in SignonIdentity
-SignonIdentityList, typedef in SignonAuthService +SignonIdentityList, typedef in SignonAuthService
-SignonIdentityReferenceAddedCb, typedef in SignonIdentity +SignonIdentityReferenceAddedCb, typedef in SignonIdentity
-SignonIdentityReferenceRemovedCb, typedef in SignonIdentity +SignonIdentityReferenceRemovedCb, typedef in SignonIdentity
-SignonIdentityRemovedCb, typedef in SignonIdentity +SignonIdentityRemovedCb, typedef in SignonIdentity
-SignonIdentitySessionReadyCb, user_function in SignonIdentity +SignonIdentitySessionReadyCb, user_function in SignonIdentity
-SignonIdentitySignedOutCb, typedef in SignonIdentity +SignonIdentitySignedOutCb, typedef in SignonIdentity
-SignonIdentityStoreCredentialsCb, user_function in SignonIdentity +SignonIdentityStoreCredentialsCb, user_function in SignonIdentity
@@ -171,172 +190,184 @@
-SignonIdentityVerifyCb, user_function in SignonIdentity +SignonIdentityVerifyCb, user_function in SignonIdentity +
+
+
+SignonIdentityVoidCb, user_function in SignonIdentity +
+
+
+signon_identity_add_reference, function in SignonIdentity +
+
+
+signon_identity_create_session, function in SignonIdentity
-SignonIdentityVoidCb, user_function in SignonIdentity +signon_identity_get_auth_session, function in SignonIdentity
-signon_identity_add_reference, function in SignonIdentity +signon_identity_get_last_error, function in SignonIdentity
-signon_identity_create_session, function in SignonIdentity +signon_identity_info_access_control_list_append, function in SignonIdentityInfo
-signon_identity_get_auth_session, function in SignonIdentity +signon_identity_info_copy, function in SignonIdentityInfo
-signon_identity_get_last_error, function in SignonIdentity +signon_identity_info_free, function in SignonIdentityInfo
-signon_identity_info_access_control_list_append, function in SignonIdentityInfo +signon_identity_info_get_access_control_list, function in SignonIdentityInfo
-signon_identity_info_copy, function in SignonIdentityInfo +signon_identity_info_get_caption, function in SignonIdentityInfo
-signon_identity_info_free, function in SignonIdentityInfo +signon_identity_info_get_id, function in SignonIdentityInfo
-signon_identity_info_get_access_control_list, function in SignonIdentityInfo +signon_identity_info_get_identity_type, function in SignonIdentityInfo
-signon_identity_info_get_caption, function in SignonIdentityInfo +signon_identity_info_get_methods, function in SignonIdentityInfo
-signon_identity_info_get_id, function in SignonIdentityInfo +signon_identity_info_get_owner, function in SignonIdentityInfo
-signon_identity_info_get_identity_type, function in SignonIdentityInfo +signon_identity_info_get_realms, function in SignonIdentityInfo
-signon_identity_info_get_methods, function in SignonIdentityInfo +signon_identity_info_get_storing_secret, function in SignonIdentityInfo
-signon_identity_info_get_owner, function in SignonIdentityInfo +signon_identity_info_get_username, function in SignonIdentityInfo
-signon_identity_info_get_realms, function in SignonIdentityInfo +signon_identity_info_new, function in SignonIdentityInfo
-signon_identity_info_get_storing_secret, function in SignonIdentityInfo +signon_identity_info_own_methods, function in SignonIdentityInfo
-signon_identity_info_get_username, function in SignonIdentityInfo +signon_identity_info_remove_method, function in SignonIdentityInfo
-signon_identity_info_new, function in SignonIdentityInfo +signon_identity_info_set_access_control_list, function in SignonIdentityInfo
-signon_identity_info_remove_method, function in SignonIdentityInfo +signon_identity_info_set_caption, function in SignonIdentityInfo
-signon_identity_info_set_access_control_list, function in SignonIdentityInfo +signon_identity_info_set_identity_type, function in SignonIdentityInfo
-signon_identity_info_set_caption, function in SignonIdentityInfo +signon_identity_info_set_method, function in SignonIdentityInfo
-signon_identity_info_set_identity_type, function in SignonIdentityInfo +signon_identity_info_set_methods, function in SignonIdentityInfo
-signon_identity_info_set_method, function in SignonIdentityInfo +signon_identity_info_set_owner, function in SignonIdentityInfo
-signon_identity_info_set_methods, function in SignonIdentityInfo +signon_identity_info_set_owner_from_values, function in SignonIdentityInfo
-signon_identity_info_set_owner, function in SignonIdentityInfo +signon_identity_info_set_realms, function in SignonIdentityInfo
-signon_identity_info_set_owner_from_values, function in SignonIdentityInfo +signon_identity_info_set_secret, function in SignonIdentityInfo
-signon_identity_info_set_realms, function in SignonIdentityInfo +signon_identity_info_set_username, function in SignonIdentityInfo
-signon_identity_info_set_secret, function in SignonIdentityInfo +signon_identity_new, function in SignonIdentity
-signon_identity_info_set_username, function in SignonIdentityInfo +signon_identity_new_from_db, function in SignonIdentity
-signon_identity_new, function in SignonIdentity +signon_identity_new_with_context, function in SignonIdentity
-signon_identity_new_from_db, function in SignonIdentity +signon_identity_new_with_context_from_db, function in SignonIdentity
-signon_identity_query_info, function in SignonIdentity +signon_identity_query_info, function in SignonIdentity
-signon_identity_remove, function in SignonIdentity +signon_identity_remove, function in SignonIdentity
-signon_identity_remove_reference, function in SignonIdentity +signon_identity_remove_reference, function in SignonIdentity
-signon_identity_signout, function in SignonIdentity +signon_identity_signout, function in SignonIdentity
-signon_identity_store_credentials_with_args, function in SignonIdentity +signon_identity_store_credentials_with_args, function in SignonIdentity
-signon_identity_store_credentials_with_info, function in SignonIdentity +signon_identity_store_credentials_with_info, function in SignonIdentity
-signon_identity_verify_secret, function in SignonIdentity +signon_identity_verify_secret, function in SignonIdentity

Q

-SignonQueryIdentitiesCb, user_function in SignonAuthService +SignonQueryIdentitiesCb, user_function in SignonAuthService
-SignonQueryMechanismCb, user_function in SignonAuthService +SignonQueryMechanismCb, user_function in SignonAuthService
-SignonQueryMethodsCb, user_function in SignonAuthService +SignonQueryMethodsCb, user_function in SignonAuthService

S

@@ -349,59 +380,59 @@
-signon_security_context_build_variant, function in SignonSecurityContext +signon_security_context_build_variant, function in SignonSecurityContext
-signon_security_context_copy, function in SignonSecurityContext +signon_security_context_copy, function in SignonSecurityContext
-signon_security_context_deconstruct_variant, function in SignonSecurityContext +signon_security_context_deconstruct_variant, function in SignonSecurityContext
-signon_security_context_free, function in SignonSecurityContext +signon_security_context_free, function in SignonSecurityContext
-signon_security_context_get_application_context, function in SignonSecurityContext +signon_security_context_get_application_context, function in SignonSecurityContext
-signon_security_context_get_system_context, function in SignonSecurityContext +signon_security_context_get_system_context, function in SignonSecurityContext
-signon_security_context_list_build_variant, function in SignonSecurityContext +signon_security_context_list_build_variant, function in SignonSecurityContext
-signon_security_context_list_copy, function in SignonSecurityContext +signon_security_context_list_copy, function in SignonSecurityContext
-signon_security_context_list_deconstruct_variant, function in SignonSecurityContext +signon_security_context_list_deconstruct_variant, function in SignonSecurityContext
-signon_security_context_list_free, function in SignonSecurityContext +signon_security_context_list_free, function in SignonSecurityContext
-signon_security_context_new, function in SignonSecurityContext +signon_security_context_new, function in SignonSecurityContext
-signon_security_context_new_from_values, function in SignonSecurityContext +signon_security_context_new_from_values, function in SignonSecurityContext
-signon_security_context_set_application_context, function in SignonSecurityContext +signon_security_context_set_application_context, function in SignonSecurityContext
-signon_security_context_set_system_context, function in SignonSecurityContext +signon_security_context_set_system_context, function in SignonSecurityContext
@@ -447,6 +478,6 @@
+ Generated by GTK-Doc V1.20 \ No newline at end of file diff --git a/docs/reference/html/appendices.html b/docs/reference/html/appendices.html index e53479c..be0e6fd 100644 --- a/docs/reference/html/appendices.html +++ b/docs/reference/html/appendices.html @@ -2,29 +2,29 @@ -Part III. Appendices - +libgsignon-glib Reference Manual: Part III. Appendices + - + - - - - - - + + + + + +

Part III. Appendices

Table of Contents

-
+
API Index
Index of deprecated symbols
Index of new symbols in 1.8
@@ -34,6 +34,6 @@
+ Generated by GTK-Doc V1.20
\ No newline at end of file diff --git a/docs/reference/html/credential-management.html b/docs/reference/html/credential-management.html index 7ca3b20..be36426 100644 --- a/docs/reference/html/credential-management.html +++ b/docs/reference/html/credential-management.html @@ -2,32 +2,32 @@ -Credential management - +libgsignon-glib Reference Manual: Credential management + - - + + - - - - - - + + + + + +

Credential management

-
+
-SignonAuthService — the authorization service object +SignonAuthService — the authorization service object
-SignonIdentity — client side presentation of a credential. +SignonIdentity — client side presentation of a credential.
SignonIdentityInfo — data contained in a SignonIdentity. @@ -45,6 +45,6 @@
+ Generated by GTK-Doc V1.20
\ No newline at end of file diff --git a/docs/reference/html/gsso-examples.html b/docs/reference/html/gsso-examples.html index ddd6958..4b77688 100644 --- a/docs/reference/html/gsso-examples.html +++ b/docs/reference/html/gsso-examples.html @@ -2,22 +2,22 @@ -gSSO usage examples - +libgsignon-glib Reference Manual: gSSO usage examples + - + - - - - - - + + + + + +
@@ -45,7 +45,7 @@

-

Authentication methods and mechanisms

+

Authentication methods and mechanisms

The list of available authentication methods can be obtained with --query-methods: @@ -74,7 +74,7 @@ Available authentication mechanisms for method oauth:

-

Identity management

+

Identity management

The list of stored identities that the gsso-example application is allowed to use can be obtained with gsso-example --query-identities: @@ -82,8 +82,8 @@ Available authentication mechanisms for method oauth:


> gsso-example --query-identities
Available identities:
-        id=27 caption='My test identity'
-        id=28 caption='Another test identity'
+        id=27 caption='My test identity' ACL: (*:*)
+        id=28 caption='Another test identity' ACL: (/usr/bin/gsso-example:)
        

@@ -99,6 +99,17 @@ Identity stored with id 28            

+ Depending on the identity method, you may also need to add a list of comma-separated + realms that are allowed to be used with an identity. For example, the oauth method + requires a list of domains that the OAuth authentication plugin is allowed to contact: +

+


+> gsso-example --create-identity="Test Google identity" --identity-method=oauth --identity-realms=google.com
+Identity stored with id 29            
+        

+

+

+

To remove an identity, use --remove-identity option with identity id:

@@ -108,9 +119,29 @@ Identity removed
        

+

+ To add security context to identity's Access Control List, use --add-context option + with identity id: +

+


+> gsso-example --add-context=28 --system-context=* --application-context=*
+Identity stored with id 28
+        

+

+

+

+ To remove security context from identity's Access Control List, use --remove-context= option + with identity id: +

+


+> gsso-example --remove-context=28 --system-context=* --application-context=*
+Identity stored with id 28
+        

+

+

-

Using 'password' authentication method

+

Using 'password' authentication method

'password' authentication simply returns to the application the username and the password associated with an identity. If they haven't been stored @@ -129,7 +160,7 @@ Got response: {'UserName': <'megauser'>, 'Secret': <'megapassword'

-

Using 'oauth' authentication method

+

Using 'oauth' authentication method

'oauth' authentication method is used to obtain an OAuth1 or OAuth2 authentication token from a remote service over HTTP. An application @@ -194,6 +225,6 @@ Got response: {'Scope': <'email'>, 'AccessToken': <'tokenvalue'>

+ Generated by GTK-Doc V1.20 \ No newline at end of file diff --git a/docs/reference/html/gsso-intro.html b/docs/reference/html/gsso-intro.html index 7328400..8e3238d 100644 --- a/docs/reference/html/gsso-intro.html +++ b/docs/reference/html/gsso-intro.html @@ -2,27 +2,27 @@ -gSSO introduction - +libgsignon-glib Reference Manual: gSSO introduction + - + - - - - - - + + + + + +
-

What is gSSO?

+

What is gSSO?

gSSO is a framework for centrally storing authentication credentials and handling authentication on behalf of applications as requested by @@ -50,26 +50,26 @@

-

Terminology

+

Terminology

gSSO is built around a few key concepts which are explained below:

-
    +
    • Authentication service: the top level object representing the gSSO service. It can be used to query existing identities, available authentication menthods and their mechanisms. Authentication service is represented in the client library by - SignonAuthService objects. + SignonAuthService objects.

    • Identity: This is a local object representing a record in the credentials DB. It contains information about the username and password (the latter is write-only), plus some metadata such as a descriptive caption, access control list, reference count, and other metadata. Identities are identified by - numeric identity IDs and represented in the client library by - SignonIdentity objects. + numeric identity IDs and represented in the client library by + SignonIdentity objects.

    • Security context: The information that is used by gSSO daemon @@ -99,6 +99,6 @@

    + Generated by GTK-Doc V1.20
\ No newline at end of file diff --git a/docs/reference/html/home.png b/docs/reference/html/home.png index fb60b552ed4965b293039b2f814a71afca95e90c..9346b336a784463192c7daab5133a3673dd69845 100644 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRMbARQqaxysz9Q}BI-m)~Y zggoA|1V*z2{cQ=d;!=?fvu4~`n82RKrk1UubNXTJj1GP|o-=>$A29f{JgJ9K`^t{Q z-oWs>M&_hvT&MjX@T4-&sBW+1^4oB5G4r2q!qGktZ!n*!)hjrjd0_4L6;4%u<}orJ u%Vo~x?#i!!ww+1OGuHe}T=cKQUzn^_t)8|WlnDbmjKR~@&t;ucLK6T-X>9fB5j>l-IX+&z`?}`|kaRPoKYh z`~LIypTGZ3G@p47sO!3?i(^Q|t+nT)!&fY+K7It<8`5*2;fuxNO3aRMvTDwK$8R_2G`Mj{ z^E<0ac3!wQQzE%;MdAv<`$uXnv9`S09_8~rhEee)yK`rlo5QUMbwDpNc)I$ztaD0e F0s!lvLUI5A diff --git a/docs/reference/html/index.html b/docs/reference/html/index.html index 528c995..e4a6d55 100644 --- a/docs/reference/html/index.html +++ b/docs/reference/html/index.html @@ -2,11 +2,11 @@ -libgsignon-glib Reference Manual - +libgsignon-glib Reference Manual: libgsignon-glib Reference Manual + - + @@ -15,7 +15,7 @@

- This document is for libgsignon-glib, version 2.0.3 + This document is for libgsignon-glib, version 2.1.0 . The latest version of this documentation can be found on-line at @@ -24,7 +24,7 @@


-
+
I. gSSO Overview
@@ -40,10 +40,10 @@
Credential management
-SignonAuthService — the authorization service object +SignonAuthService — the authorization service object
-SignonIdentity — client side presentation of a credential. +SignonIdentity — client side presentation of a credential.
SignonIdentityInfo — data contained in a SignonIdentity. @@ -70,6 +70,6 @@
+ Generated by GTK-Doc V1.20
\ No newline at end of file diff --git a/docs/reference/html/index.sgml b/docs/reference/html/index.sgml index 8238d1f..55ce18a 100644 --- a/docs/reference/html/index.sgml +++ b/docs/reference/html/index.sgml @@ -2,58 +2,70 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - - - - + @@ -67,6 +79,7 @@ + @@ -78,13 +91,15 @@ + + + - + + - - - + @@ -99,13 +114,28 @@ + + + - - + + + - + + + + + + + + + + + + @@ -117,69 +147,24 @@ - - - - - - - - - - - - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - + diff --git a/docs/reference/html/left-insensitive.png b/docs/reference/html/left-insensitive.png new file mode 100644 index 0000000000000000000000000000000000000000..3269393a7f72af744a772c437bd7b3976c23709d GIT binary patch literal 395 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefH0HbvDJm`3=E7Co-U3d7N^fnTIWJ3j{^~q!iyia4kV=mdU|Jhfgdm;SLIpiYJ7wv^kjFiECCc&8T30!RG0~&BG=X zlu#U4@Z`))V`EG9e^NqDr#{!5k|)wT* zYTNt0`@q%TAD$){%#eQ?;$^ly8}yZCU%T~u0XM^%t?f#e znB*EuLv2rP%K3BMvFO}YmnR}KSgH;`EHL$)^!tH~iBxZ#h^zJi*#P5Xb6B50U@nx2 mU;T=yfcwnSOsS9SKd{M#MlNkCuvG>I8-u5-pUXO@geCx5`k@p6 literal 0 HcmV?d00001 diff --git a/docs/reference/html/left.png b/docs/reference/html/left.png index 48cab276723733c79792bf270990592938a46e1f..2abde032b0c98b756b12d380da4318205cd78470 100644 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRMaSLay~*pwMJb7sn8b(^oI8=R24v(*CjE{-BFv z0BhvLm?o9(UC{-Ci?lD?Ve-7-xypA!PTC(0^;>UheG4Altep3@`rO0#Rjs1)RxCLr zE5mee>7m*=%yEk+GVvGkRy0O&*&MTd5SjH(lgq~7r%6oRW$l1p-*S}iC>@fyDsz%y z`UIW8^Ao=maGhj3E8{7Cd_qof`K4oa->23`>&M2+XBtd2J`8jogQu&X%Q~loCIG_? BVG#fT literal 373 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaA)dl#3xB}__)B_+ZBqTI6G_0+y z9UL4Q8XB6Lo0l(Ne*OCO`}glZe*F0P^XIQ$zyAFB^Y7okf!3B;efk5`BUKXQ7tFxI zBOsw-U}EEukX}$--`zib{^He#Z{Pp?dtyH?D^OLBr;B4q#jV^+H-(xE1Y9l_Iu;z4 zZR+ak`upELn{z+1{HV^C3RAUx`dg(vwnTdruGcuhx4p|L{wTx5ZYPx&X4B#s`RabR uK2tDo4+%_Il(5uMF~;EeeHHIRk9osW6@K4xn;Q#s7lWs(pUXO@geCwjBg*ao diff --git a/docs/reference/html/libgsignon-glib-SignonAuthService.html b/docs/reference/html/libgsignon-glib-SignonAuthService.html deleted file mode 100644 index bf46132..0000000 --- a/docs/reference/html/libgsignon-glib-SignonAuthService.html +++ /dev/null @@ -1,371 +0,0 @@ - - - - -SignonAuthService - - - - - - - - - - - - - - - - - - - -
-
-
- - -
-

SignonAuthService

-

SignonAuthService — the authorization service object

-
-
-

Synopsis

-
struct              SignonAuthServiceClass;
-typedef             SignonIdentityFilter;
-typedef             SignonIdentityList;
-void                (*SignonQueryIdentitiesCb)          (SignonAuthService *auth_service,
-                                                         SignonIdentityList *identities,
-                                                         const GError *error,
-                                                         gpointer user_data);
-void                (*SignonQueryMechanismCb)           (SignonAuthService *auth_service,
-                                                         const gchar *method,
-                                                         gchar **mechanisms,
-                                                         const GError *error,
-                                                         gpointer user_data);
-void                (*SignonQueryMethodsCb)             (SignonAuthService *auth_service,
-                                                         gchar **methods,
-                                                         const GError *error,
-                                                         gpointer user_data);
-SignonAuthService * signon_auth_service_new             ();
-void                signon_auth_service_query_identities
-                                                        (SignonAuthService *auth_service,
-                                                         SignonIdentityFilter *filter,
-                                                         const gchar *application_context,
-                                                         SignonQueryIdentitiesCb cb,
-                                                         gpointer user_data);
-void                signon_auth_service_query_mechanisms
-                                                        (SignonAuthService *auth_service,
-                                                         const gchar *method,
-                                                         SignonQueryMechanismCb cb,
-                                                         gpointer user_data);
-void                signon_auth_service_query_methods   (SignonAuthService *auth_service,
-                                                         SignonQueryMethodsCb cb,
-                                                         gpointer user_data);
-
-
-
-

Description

-

-The SignonAuthService is the main object in this library. It provides top-level -functions to query existing identities, available methods and their mechanisms. -

-
-
-

Details

-
-

struct SignonAuthServiceClass

-
struct SignonAuthServiceClass {
-    GObjectClass parent_class;
-};
-
-

-Opaque struct. Use the accessor functions below. -

-
-- - - - -

GObjectClass parent_class;

a reference to the parent class
-
-
-
-

SignonIdentityFilter

-
typedef GHashTable SignonIdentityFilter;
-
-

-GHashTable based filter variant dictionary. -

-
-
-
-

SignonIdentityList

-
typedef GList SignonIdentityList;
-
-

-GList of SignonIdentity items. -

-
-
-
-

SignonQueryIdentitiesCb ()

-
void                (*SignonQueryIdentitiesCb)          (SignonAuthService *auth_service,
-                                                         SignonIdentityList *identities,
-                                                         const GError *error,
-                                                         gpointer user_data);
-

-Callback to be passed to signon_auth_service_query_identities(). -

-
-- - - - - - - - - - - - - - - - - - -

auth_service :

the SignonAuthService.

identities :

-GList based list of SignonIdentityInfo. [transfer full] -

error :

a GError if an error occurred, NULL otherwise.

user_data :

the user data that was passed when installing this callback.
-
-
-
-

SignonQueryMechanismCb ()

-
void                (*SignonQueryMechanismCb)           (SignonAuthService *auth_service,
-                                                         const gchar *method,
-                                                         gchar **mechanisms,
-                                                         const GError *error,
-                                                         gpointer user_data);
-

-Callback to be passed to signon_auth_service_query_mechanisms(). -

-
-- - - - - - - - - - - - - - - - - - - - - - -

auth_service :

the SignonAuthService.

method :

the authentication method being inspected.

mechanisms :

list of available mechanisms. [transfer full][type GStrv] -

error :

a GError if an error occurred, NULL otherwise.

user_data :

the user data that was passed when installing this callback.
-
-
-
-

SignonQueryMethodsCb ()

-
void                (*SignonQueryMethodsCb)             (SignonAuthService *auth_service,
-                                                         gchar **methods,
-                                                         const GError *error,
-                                                         gpointer user_data);
-

-Callback to be passed to signon_auth_service_query_methods(). -

-
-- - - - - - - - - - - - - - - - - - -

auth_service :

the SignonAuthService.

methods :

list of available methods. [transfer full][type GStrv] -

error :

a GError if an error occurred, NULL otherwise.

user_data :

the user data that was passed when installing this callback.
-
-
-
-

signon_auth_service_new ()

-
SignonAuthService * signon_auth_service_new             ();
-

-Create a new SignonAuthService. -

-
-- - - - -

Returns :

an instance of an SignonAuthService.
-
-
-
-

signon_auth_service_query_identities ()

-
void                signon_auth_service_query_identities
-                                                        (SignonAuthService *auth_service,
-                                                         SignonIdentityFilter *filter,
-                                                         const gchar *application_context,
-                                                         SignonQueryIdentitiesCb cb,
-                                                         gpointer user_data);
-

-Query available identities, possibly applying a filter. -

-

-filter is a GHashTable that contains filter conditions in the form of -string keys and GVariant values. Currently the following keys are supported: -

-

-

-
    -
  • "Owner". The value should be a SignonSecurityContext (use -signon_security_context_build_variant() to create a GVariant). -Identites whose owner doesn't match will be filtered out. This key has -effect only if the requesting application is a keychain application as determined -by GSignondAccessControlManager.

  • -
  • "Type". The value should be a SignonIdentityType.

  • -
  • "Caption". The value is a string, and only those identites whose caption -begins with the supplied value will be returned.

  • -
-

-

-

-The meaning of application_context is explained in SignonSecurityContext. -It is used by GSignondAccessControlManager to determine if the requesting -application is a keychain application. If it is, then all identites will be -returned (subject to "Owner" key in filter). If it's not, then only the -identites which the application owns will be returned (but "Type" and "Caption" -can still be set in the filter). -

-
-- - - - - - - - - - - - - - - - - - - - - - -

auth_service :

the SignonAuthService.

filter :

filter variant dictionary based on GHashTable.

application_context :

application security context, can be NULL.

cb :

callback to be invoked. [scope async] -

user_data :

user data.
-
-
-
-

signon_auth_service_query_mechanisms ()

-
void                signon_auth_service_query_mechanisms
-                                                        (SignonAuthService *auth_service,
-                                                         const gchar *method,
-                                                         SignonQueryMechanismCb cb,
-                                                         gpointer user_data);
-

-Lists all the available mechanisms for an authentication method. -

-
-- - - - - - - - - - - - - - - - - - -

auth_service :

the SignonAuthService.

method :

the name of the method whose mechanisms must be -retrieved.

cb :

callback to be invoked. [scope async] -

user_data :

user data.
-
-
-
-

signon_auth_service_query_methods ()

-
void                signon_auth_service_query_methods   (SignonAuthService *auth_service,
-                                                         SignonQueryMethodsCb cb,
-                                                         gpointer user_data);
-

-Lists all the available authentication methods. -

-
-- - - - - - - - - - - - - - -

auth_service :

the SignonAuthService.

cb :

callback to be invoked. [scope async] -

user_data :

user data.
-
-
-
- - - \ No newline at end of file diff --git a/docs/reference/html/libgsignon-glib-SignonError.html b/docs/reference/html/libgsignon-glib-SignonError.html index 6847d07..66e30ef 100644 --- a/docs/reference/html/libgsignon-glib-SignonError.html +++ b/docs/reference/html/libgsignon-glib-SignonError.html @@ -2,30 +2,27 @@ -SignonError - +libgsignon-glib Reference Manual: SignonError + - + - - - - - - - - - - + + + + + + +
@@ -33,283 +30,348 @@

SignonError

SignonError — possible gSSO errors

- +
-
-

Synopsis

-
#define             SIGNON_ERROR
-enum                SignonError;
-GQuark              signon_error_quark                  (void);
+
+

Functions

+
++++ + + + + + + + + + + +
#defineSIGNON_ERROR
+GQuark + +signon_error_quark () +
+
+
+

Types and Values

+
++++ + + + + +
enumSignonError
+
+
+

Object Hierarchy

+
 

Description

-

-An enumeration of errors that are possible when using gSSO -

+

An enumeration of errors that are possible when using gSSO

-

Details

+

Functions

SIGNON_ERROR

#define SIGNON_ERROR (signon_error_quark())
 
-

-This macro is used when creating a GError in libgsignond-glib library -

+

This macro is used when creating a GError in libgsignond-glib library


+

signon_error_quark ()

+
GQuark
+signon_error_quark (void);
+

Creates and returns a domain for gSSO errors.

+
+
+
+

Types and Values

+

enum SignonError

-
typedef enum {
-    SIGNON_ERROR_UNKNOWN = 1,
-    SIGNON_ERROR_INTERNAL_SERVER = 2,
-    SIGNON_ERROR_INTERNAL_COMMUNICATION = 3,
-    SIGNON_ERROR_PERMISSION_DENIED = 4,
-
-    SIGNON_ERROR_METHOD_NOT_KNOWN = 101,
-    SIGNON_ERROR_SERVICE_NOT_AVAILABLE,
-    SIGNON_ERROR_INVALID_QUERY,
-
-    SIGNON_ERROR_METHOD_NOT_AVAILABLE = 201,
-    SIGNON_ERROR_IDENTITY_NOT_FOUND,
-    SIGNON_ERROR_STORE_FAILED,
-    SIGNON_ERROR_REMOVE_FAILED,
-    SIGNON_ERROR_SIGNOUT_FAILED,
-    SIGNON_ERROR_IDENTITY_OPERATION_CANCELED,
-    SIGNON_ERROR_CREDENTIALS_NOT_AVAILABLE,
-    SIGNON_ERROR_REFERENCE_NOT_FOUND,
-
-    SIGNON_ERROR_MECHANISM_NOT_AVAILABLE = 301,
-    SIGNON_ERROR_MISSING_DATA,
-    SIGNON_ERROR_INVALID_CREDENTIALS,
-    SIGNON_ERROR_NOT_AUTHORIZED,
-    SIGNON_ERROR_WRONG_STATE,
-    SIGNON_ERROR_OPERATION_NOT_SUPPORTED,
-    SIGNON_ERROR_NO_CONNECTION,
-    SIGNON_ERROR_NETWORK,
-    SIGNON_ERROR_SSL,
-    SIGNON_ERROR_RUNTIME,
-    SIGNON_ERROR_SESSION_CANCELED,
-    SIGNON_ERROR_TIMED_OUT,
-    SIGNON_ERROR_USER_INTERACTION,
-    SIGNON_ERROR_OPERATION_FAILED,
-    SIGNON_ERROR_ENCRYPTION_FAILED,
-    SIGNON_ERROR_TOS_NOT_ACCEPTED,
-    SIGNON_ERROR_FORGOT_PASSWORD,
-    SIGNON_ERROR_METHOD_OR_MECHANISM_NOT_ALLOWED,
-    SIGNON_ERROR_INCORRECT_DATE,
-    SIGNON_ERROR_USER_ERROR = 400
-} SignonError;
-
-

-Possible Signon errors. -

-
-+

Possible Signon errors.

+
+

Members

+
+++++ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +

SIGNON_ERROR_UNKNOWN

Catch-all for errors not distinguished by another code. +

SIGNON_ERROR_UNKNOWN

+

Catch-all for errors not distinguished by another code.

 

SIGNON_ERROR_INTERNAL_SERVER

Signon daemon internal error. +

SIGNON_ERROR_INTERNAL_SERVER

+

Signon daemon internal error.

 

SIGNON_ERROR_INTERNAL_COMMUNICATION

Error communicating with Signon daemon. +

SIGNON_ERROR_INTERNAL_COMMUNICATION

+

Error communicating with Signon daemon.

 

SIGNON_ERROR_PERMISSION_DENIED

The operation cannot be performed due to -insufficient client permissions. +

SIGNON_ERROR_PERMISSION_DENIED

+

The operation cannot be performed due to +insufficient client permissions.

 

SIGNON_ERROR_METHOD_NOT_KNOWN

The method with this name was not found. +

SIGNON_ERROR_METHOD_NOT_KNOWN

+

The method with this name was not found.

 

SIGNON_ERROR_SERVICE_NOT_AVAILABLE

The service is temporarily unavailable. +

SIGNON_ERROR_SERVICE_NOT_AVAILABLE

+

The service is temporarily unavailable.

 

SIGNON_ERROR_INVALID_QUERY

Parameters for the query are invalid. +

SIGNON_ERROR_INVALID_QUERY

+

Parameters for the query are invalid.

 

SIGNON_ERROR_METHOD_NOT_AVAILABLE

The requested method is not available. +

SIGNON_ERROR_METHOD_NOT_AVAILABLE

+

The requested method is not available.

 

SIGNON_ERROR_IDENTITY_NOT_FOUND

The identity mathching the SignonIdentity -was not found on the service. +

SIGNON_ERROR_IDENTITY_NOT_FOUND

+

The identity mathching the SignonIdentity +was not found on the service.

 

SIGNON_ERROR_STORE_FAILED

Storing credentials failed. +

SIGNON_ERROR_STORE_FAILED

+

Storing credentials failed.

 

SIGNON_ERROR_REMOVE_FAILED

Removing credentials failed. +

SIGNON_ERROR_REMOVE_FAILED

+

Removing credentials failed.

 

SIGNON_ERROR_SIGNOUT_FAILED

Signing out failed. +

SIGNON_ERROR_SIGNOUT_FAILED

+

Signing out failed.

 

SIGNON_ERROR_IDENTITY_OPERATION_CANCELED

Identity operation was canceled -by the user. +

SIGNON_ERROR_IDENTITY_OPERATION_CANCELED

+

Identity operation was canceled +by the user.

 

SIGNON_ERROR_CREDENTIALS_NOT_AVAILABLE

Query failed. +

SIGNON_ERROR_CREDENTIALS_NOT_AVAILABLE

+

Query failed.

 

SIGNON_ERROR_REFERENCE_NOT_FOUND

Trying to remove non-existent reference. +

SIGNON_ERROR_REFERENCE_NOT_FOUND

+

Trying to remove non-existent reference.

 

SIGNON_ERROR_MECHANISM_NOT_AVAILABLE

The requested mechanism in not -available. +

SIGNON_ERROR_MECHANISM_NOT_AVAILABLE

+

The requested mechanism in not +available.

 

SIGNON_ERROR_MISSING_DATA

The SessionData does not contain the necessary -information. +

SIGNON_ERROR_MISSING_DATA

+

The SessionData does not contain the necessary +information.

 

SIGNON_ERROR_INVALID_CREDENTIALS

The supplied credentials are invalid for -the mechanism implementation. +

SIGNON_ERROR_INVALID_CREDENTIALS

+

The supplied credentials are invalid for +the mechanism implementation.

 

SIGNON_ERROR_NOT_AUTHORIZED

Authorization failed. +

SIGNON_ERROR_NOT_AUTHORIZED

+

Authorization failed.

 

SIGNON_ERROR_WRONG_STATE

An operation method has been called in an -incorrect state. +

SIGNON_ERROR_WRONG_STATE

+

An operation method has been called in an +incorrect state.

 

SIGNON_ERROR_OPERATION_NOT_SUPPORTED

The operation is not supported by the -mechanism implementation. +

SIGNON_ERROR_OPERATION_NOT_SUPPORTED

+

The operation is not supported by the +mechanism implementation.

 

SIGNON_ERROR_NO_CONNECTION

No network connection. +

SIGNON_ERROR_NO_CONNECTION

+

No network connection.

 

SIGNON_ERROR_NETWORK

Network connection failed. +

SIGNON_ERROR_NETWORK

+

Network connection failed.

 

SIGNON_ERROR_SSL

SSL connection failed. +

SIGNON_ERROR_SSL

+

SSL connection failed.

 

SIGNON_ERROR_RUNTIME

Casting SessionData into subclass failed. +

SIGNON_ERROR_RUNTIME

+

Casting SessionData into subclass failed.

 

SIGNON_ERROR_SESSION_CANCELED

Challenge was canceled. +

SIGNON_ERROR_SESSION_CANCELED

+

Challenge was canceled.

 

SIGNON_ERROR_TIMED_OUT

Challenge timed out. +

SIGNON_ERROR_TIMED_OUT

+

Challenge timed out.

 

SIGNON_ERROR_USER_INTERACTION

User interaction dialog failed. +

SIGNON_ERROR_USER_INTERACTION

+

User interaction dialog failed.

 

SIGNON_ERROR_OPERATION_FAILED

Temporary failure in authentication. +

SIGNON_ERROR_OPERATION_FAILED

+

Temporary failure in authentication.

 

SIGNON_ERROR_ENCRYPTION_FAILED

-deprecated: Failure during data -encryption/decryption. +

SIGNON_ERROR_ENCRYPTION_FAILED

+

deprecated +: Failure during data +encryption/decryption.

 

SIGNON_ERROR_TOS_NOT_ACCEPTED

User declined Terms of Service. +

SIGNON_ERROR_TOS_NOT_ACCEPTED

+

User declined Terms of Service.

 

SIGNON_ERROR_FORGOT_PASSWORD

User requested password reset sequence. +

SIGNON_ERROR_FORGOT_PASSWORD

+

User requested password reset sequence.

 

SIGNON_ERROR_METHOD_OR_MECHANISM_NOT_ALLOWED

Method or mechanism not -allowed for this identity. +

SIGNON_ERROR_METHOD_OR_MECHANISM_NOT_ALLOWED

+

Method or mechanism not +allowed for this identity.

 

SIGNON_ERROR_INCORRECT_DATE

Date/time incorrect on device. +

SIGNON_ERROR_INCORRECT_DATE

+

Date/time incorrect on device.

 

SIGNON_ERROR_USER_ERROR

Placeholder to rearrange enumeration - userspace -specific. +

SIGNON_ERROR_USER_ERROR

+

Placeholder to rearrange enumeration - userspace +specific.

 
-
-
-

signon_error_quark ()

-
GQuark              signon_error_quark                  (void);
-

-Creates and returns a domain for gSSO errors. -

+ Generated by GTK-Doc V1.20
\ No newline at end of file diff --git a/docs/reference/html/libgsignon-glib-SignonIdentity.html b/docs/reference/html/libgsignon-glib-SignonIdentity.html deleted file mode 100644 index d494987..0000000 --- a/docs/reference/html/libgsignon-glib-SignonIdentity.html +++ /dev/null @@ -1,946 +0,0 @@ - - - - -SignonIdentity - - - - - - - - - - - - - - - - - - - -
-
-
- - -
-

SignonIdentity

-

SignonIdentity — client side presentation of a credential.

-
-
-

Synopsis

-
struct              SignonIdentityClass;
-void                (*SignonIdentityInfoCb)             (SignonIdentity *self,
-                                                         const SignonIdentityInfo *info,
-                                                         const GError *error,
-                                                         gpointer user_data);
-typedef             SignonIdentityReferenceAddedCb;
-typedef             SignonIdentityReferenceRemovedCb;
-typedef             SignonIdentityRemovedCb;
-void                (*SignonIdentitySessionReadyCb)     (SignonAuthSession *self,
-                                                         GError *error,
-                                                         GDBusConnection *connection,
-                                                         const gchar *bus_name,
-                                                         const gchar *object_path);
-typedef             SignonIdentitySignedOutCb;
-void                (*SignonIdentityStoreCredentialsCb) (SignonIdentity *self,
-                                                         guint32 id,
-                                                         const GError *error,
-                                                         gpointer user_data);
-void                (*SignonIdentityVerifyCb)           (SignonIdentity *self,
-                                                         gboolean valid,
-                                                         const GError *error,
-                                                         gpointer user_data);
-void                (*SignonIdentityVoidCb)             (SignonIdentity *self,
-                                                         const GError *error,
-                                                         gpointer user_data);
-void                signon_identity_add_reference       (SignonIdentity *self,
-                                                         const gchar *reference,
-                                                         SignonIdentityReferenceAddedCb cb,
-                                                         gpointer user_data);
-SignonAuthSession * signon_identity_create_session      (SignonIdentity *self,
-                                                         const gchar *method,
-                                                         GError **error);
-void                signon_identity_get_auth_session    (SignonIdentity *self,
-                                                         SignonAuthSession *session,
-                                                         const gchar *method,
-                                                         SignonIdentitySessionReadyCb cb);
-const GError *      signon_identity_get_last_error      (SignonIdentity *identity);
-SignonIdentity *    signon_identity_new                 (const gchar *application_context);
-SignonIdentity *    signon_identity_new_from_db         (guint32 id,
-                                                         const gchar *application_context);
-void                signon_identity_query_info          (SignonIdentity *self,
-                                                         SignonIdentityInfoCb cb,
-                                                         gpointer user_data);
-void                signon_identity_remove              (SignonIdentity *self,
-                                                         SignonIdentityRemovedCb cb,
-                                                         gpointer user_data);
-void                signon_identity_remove_reference    (SignonIdentity *self,
-                                                         const gchar *reference,
-                                                         SignonIdentityReferenceRemovedCb cb,
-                                                         gpointer user_data);
-void                signon_identity_signout             (SignonIdentity *self,
-                                                         SignonIdentitySignedOutCb cb,
-                                                         gpointer user_data);
-void                signon_identity_store_credentials_with_args
-                                                        (SignonIdentity *self,
-                                                         const gchar *username,
-                                                         const gchar *secret,
-                                                         const gboolean store_secret,
-                                                         const GHashTable *methods,
-                                                         const gchar *caption,
-                                                         const gchar * const *realms,
-                                                         const SignonSecurityContext *owner,
-                                                         const SignonSecurityContextList *access_control_list,
-                                                         SignonIdentityType type,
-                                                         SignonIdentityStoreCredentialsCb cb,
-                                                         gpointer user_data);
-void                signon_identity_store_credentials_with_info
-                                                        (SignonIdentity *self,
-                                                         const SignonIdentityInfo *info,
-                                                         SignonIdentityStoreCredentialsCb cb,
-                                                         gpointer user_data);
-void                signon_identity_verify_secret       (SignonIdentity *self,
-                                                         const gchar *secret,
-                                                         SignonIdentityVerifyCb cb,
-                                                         gpointer user_data);
-
-
-
-

Description

-

-The SignonIdentity objects represent identities and provide operations that -can be performed on them such as identity creation, removal, starting an authentication -session, and so on. -

-

-Identities can also be stored and retrieved from a gSSO database, in which -case they also contain a number of properties that can be retrieved -using signon_identity_query_info() and are represented via SignonIdentityInfo. -Such identities are identified by a numeric id number and they are subject -to access control. -

-

-

-
-

Operations on an identity

-
-

-

-

-

-
  • a new identity can be created with signon_identity_new(). This operation -does not store the identity to the database, the identity is not visible -to other applications, and accordingly it is not subject to access control.

-

-

-

-

-
-

-

-

-

-
-

-

-

-

-
  • identities stored in a database can be retrieved using signon_identity_new_from_db(), -subject to access control (an application performing that operation has to be -either the identity's owner, or it has to be on the ACL list).

-

-

-

-

-
-

-

-

-

-
-

-

-

-

-
  • identity owners can request to close all authentication sessions and -remove all secrets and tokens using signon_identity_signout().

-

-

-

-

-
-

Data fields in SignonIdentityInfo -

-
-

-

-

-These are the data fields that are stored into the database as a part of an -identity record using signon_identity_store_credentials_with_args() or -signon_identity_store_credentials_with_info() and can be retrieved using -signon_identity_query_info() or signon_auth_service_query_identities(): -

-

-

-
  • Caption is a display name for the identity, presented to the user. Default -value is an empty caption.

-

-

-

-

-
  • Realms is a list of realms that the identity can be used in. - Interpretation of this field is up to the method. Typically it is - a list of internet domains allowed for an authentication request. - Default value is an empty list.

-

-

-

-

-
-

-

-

-

-
  • Owner is a SignonSecurityContext object, which specifies the identity -owner. Owners are allowed to perform all of the operations on the identity -specified above. By default an identity's owner is determined by gSSO daemon -using system services for the system context, and a string supplied in -signon_identity_new() for the application context.

-

-

-

-

-
  • ACL is a list of SignonSecurityContext objects, that specifies applications -that can access the identity to perform authentication sessions. They're not -allowed to make any changes to the identity. Default value is an empty list, -and depending on how gSSO is configured it's also possible to provide a list -with a wildcard item to relax the access control restriction -(see SignonSecurityContext).

-

-

-

-

-
  • Methods is a GHashTable containing method names as keys, and lists of -allowed mechanisms as values (also, a special value "*" means that any -mechanism is allowed). Only those methods and mechanisms that are in the table -are allowed to be used in authentication sessions. Default is an empty list.

-

-

-

-

-
  • Id is a numeric identification of the identity record in the database. The -application cannot set this, as it's determined by the daemon.

-

-

-

-

-
  • Username is used to provide a username to authentication plugins after -issuing signon_auth_session_process_async(). Applications can override this -by providing a username explicitly in the session_data parameter to that -function. By default there is no username.

-

-

-

-

-
  • Secret is used in the same way as username, but it is write-only (cannot -be retrieved from a SignonIdentityInfo). It is also possible to prevent -secret from being stored in the database.

-

-

-
-
-

Details

-
-

struct SignonIdentityClass

-
struct SignonIdentityClass {
-    GObjectClass parent_class;
-};
-
-

-Opaque struct. Use the accessor functions below. -

-
-- - - - -

GObjectClass parent_class;

reference to a parent class
-
-
-
-

SignonIdentityInfoCb ()

-
void                (*SignonIdentityInfoCb)             (SignonIdentity *self,
-                                                         const SignonIdentityInfo *info,
-                                                         const GError *error,
-                                                         gpointer user_data);
-

-Callback to be passed to signon_identity_query_info(). -

-
-- - - - - - - - - - - - - - - - - - -

self :

the SignonIdentity.

info :

the SignonIdentityInfo for self.

error :

a GError if an error occurred, or NULL otherwise.

user_data :

the user data that was passed when installing this callback.
-
-
-
-

SignonIdentityReferenceAddedCb

-
typedef SignonIdentityVoidCb SignonIdentityReferenceAddedCb;
-
-

-Callback to be passed to signon_identity_add_reference(). -

-
-
-
-

SignonIdentityReferenceRemovedCb

-
typedef SignonIdentityVoidCb SignonIdentityReferenceRemovedCb;
-
-

-Callback to be passed to signon_identity_remove_reference(). -

-
-
-
-

SignonIdentityRemovedCb

-
typedef SignonIdentityVoidCb SignonIdentityRemovedCb;
-
-

-Callback to be passed to signon_identity_remove(). -

-
-
-
-

SignonIdentitySessionReadyCb ()

-
void                (*SignonIdentitySessionReadyCb)     (SignonAuthSession *self,
-                                                         GError *error,
-                                                         GDBusConnection *connection,
-                                                         const gchar *bus_name,
-                                                         const gchar *object_path);
-

-Callback to be passed to signon_identity_get_auth_session(). -

-
-- - - - - - - - - - - - - - - - - - - - - - -

self :

the SignonAuthSession.

error :

a GError if an error occurred, or NULL otherwise.

connection :

a GDBusConnection for the session.

bus_name :

a D-Bus bus name for the session.

object_path :

a D-Bus object path for the session.
-
-
-
-

SignonIdentitySignedOutCb

-
typedef SignonIdentityVoidCb SignonIdentitySignedOutCb;
-
-

-Callback to be passed to signon_identity_signout(). -

-
-
-
-

SignonIdentityStoreCredentialsCb ()

-
void                (*SignonIdentityStoreCredentialsCb) (SignonIdentity *self,
-                                                         guint32 id,
-                                                         const GError *error,
-                                                         gpointer user_data);
-

-Callback to be passed to signon_identity_store_credentials_with_args() or -signon_identity_store_credentials_with_info(). -

-
-- - - - - - - - - - - - - - - - - - -

self :

the SignonIdentity.

id :

the numeric ID of the identity in the database.

error :

a GError if an error occurred, or NULL otherwise.

user_data :

the user data that was passed when installing this callback.
-
-
-
-

SignonIdentityVerifyCb ()

-
void                (*SignonIdentityVerifyCb)           (SignonIdentity *self,
-                                                         gboolean valid,
-                                                         const GError *error,
-                                                         gpointer user_data);
-

-Callback to be passed to signon_identity_verify_secret(). -

-
-- - - - - - - - - - - - - - - - - - -

self :

the SignonIdentity.

valid :

whether the secret is valid.

error :

a GError if an error occurred, or NULL otherwise.

user_data :

the user data that was passed when installing this callback.
-
-
-
-

SignonIdentityVoidCb ()

-
void                (*SignonIdentityVoidCb)             (SignonIdentity *self,
-                                                         const GError *error,
-                                                         gpointer user_data);
-

-Generic callback to be passed to several SignonIdentity methods. -

-
-- - - - - - - - - - - - - - -

self :

the SignonIdentity.

error :

a GError if an error occurred, or NULL otherwise.

user_data :

the user data that was passed when installing this callback.
-
-
-
-

signon_identity_add_reference ()

-
void                signon_identity_add_reference       (SignonIdentity *self,
-                                                         const gchar *reference,
-                                                         SignonIdentityReferenceAddedCb cb,
-                                                         gpointer user_data);
-

-Adds named reference to identity. Not currently supported by gSSO. -

-
-- - - - - - - - - - - - - - - - - - -

self :

the SignonIdentity.

reference :

reference to be added

cb :

callback

user_data :

user_data.
-
-
-
-

signon_identity_create_session ()

-
SignonAuthSession * signon_identity_create_session      (SignonIdentity *self,
-                                                         const gchar *method,
-                                                         GError **error);
-

-Creates an authentication session for this identity. If the identity has been -retrieved from the database, the authentication method must be one of those -listed in signon_identity_info_get_methods(), otherwise it can be any method -supported by gSSO. -

-
-- - - - - - - - - - - - - - - - - - -

self :

the SignonIdentity.

method :

authentication method.

error :

pointer to a location which will receive the error, if any.

Returns :

a new SignonAuthSession. [transfer full] -
-
-
-
-

signon_identity_get_auth_session ()

-
void                signon_identity_get_auth_session    (SignonIdentity *self,
-                                                         SignonAuthSession *session,
-                                                         const gchar *method,
-                                                         SignonIdentitySessionReadyCb cb);
-

-Obtain a remote object for a local session object. Should not be used by -applications. -

-
-- - - - - - - - - - - - - - - - - - -

self :

the SignonIdentity.

session :

the SignonAuthSession object to get the remote object for.

method :

method name for the session.

cb :

completion callback. [scope async] -
-
-
-
-

signon_identity_get_last_error ()

-
const GError *      signon_identity_get_last_error      (SignonIdentity *identity);
-

-Get the most recent error that occurred on identity. -

-
-- - - - - - - - - - -

identity :

the SignonIdentity.

Returns :

a GError containing the most recent error, or NULL on failure.
-
-
-
-

signon_identity_new ()

-
SignonIdentity *    signon_identity_new                 (const gchar *application_context);
-

-Construct a new, empty, identity object. See SignonSecurityContext for a -discussion of application_context contents. application_context is used to set the identity's owner -if the identity is stored to the database with signon_identity_store_credentials_with_args() -or signon_identity_store_credentials_with_info(). -

-
-- - - - - - - - - - -

application_context :

application security context, can be NULL.

Returns :

an instance of an SignonIdentity.
-
-
-
-

signon_identity_new_from_db ()

-
SignonIdentity *    signon_identity_new_from_db         (guint32 id,
-                                                         const gchar *application_context);
-

-Construct an identity object associated with an existing identity -record. See SignonSecurityContext for a discussion of application_context contents. -Together with the system context it is used to determine by the gSSO daemon -if the application can access the identity (the application needs to be either the -identity's owner or to be present on the ACL). -

-

-Applications can determine the id either by enumerating the identities with -signon_auth_service_query_identities() (if they're the owner of the identity) -or via other means (such as the system's accounts service, or an application -configuration). -

-
-- - - - - - - - - - - - - - -

id :

identity ID.

application_context :

application security context, can be NULL.

Returns :

an instance of a SignonIdentity.
-
-
-
-

signon_identity_query_info ()

-
void                signon_identity_query_info          (SignonIdentity *self,
-                                                         SignonIdentityInfoCb cb,
-                                                         gpointer user_data);
-

-Fetches the SignonIdentityInfo data associated with this -identity. -

-
-- - - - - - - - - - - - - - -

self :

the SignonIdentity.

cb :

callback. [scope async] -

user_data :

user_data.
-
-
-
-

signon_identity_remove ()

-
void                signon_identity_remove              (SignonIdentity *self,
-                                                         SignonIdentityRemovedCb cb,
-                                                         gpointer user_data);
-

-Removes the corresponding credentials record from the database. -

-
-- - - - - - - - - - - - - - -

self :

the SignonIdentity.

cb :

callback to be called when the operation has completed. [scope async] -

user_data :

user_data to pass to the callback.
-
-
-
-

signon_identity_remove_reference ()

-
void                signon_identity_remove_reference    (SignonIdentity *self,
-                                                         const gchar *reference,
-                                                         SignonIdentityReferenceRemovedCb cb,
-                                                         gpointer user_data);
-

-Removes named reference from identity. Not currently supported by gSSO. -

-
-- - - - - - - - - - - - - - - - - - -

self :

the SignonIdentity.

reference :

reference to be removed

cb :

callback

user_data :

user_data.
-
-
-
-

signon_identity_signout ()

-
void                signon_identity_signout             (SignonIdentity *self,
-                                                         SignonIdentitySignedOutCb cb,
-                                                         gpointer user_data);
-

-Asks signond to close all authentication sessions for this -identity, and to remove any stored secrets associated with it (password and -authentication tokens). -

-
-- - - - - - - - - - - - - - -

self :

the SignonIdentity.

cb :

callback. [scope async] -

user_data :

user_data.
-
-
-
-

signon_identity_store_credentials_with_args ()

-
void                signon_identity_store_credentials_with_args
-                                                        (SignonIdentity *self,
-                                                         const gchar *username,
-                                                         const gchar *secret,
-                                                         const gboolean store_secret,
-                                                         const GHashTable *methods,
-                                                         const gchar *caption,
-                                                         const gchar * const *realms,
-                                                         const SignonSecurityContext *owner,
-                                                         const SignonSecurityContextList *access_control_list,
-                                                         SignonIdentityType type,
-                                                         SignonIdentityStoreCredentialsCb cb,
-                                                         gpointer user_data);
-

-Stores the given data into the identity. See above for the meaning -of the specific fields. -

-
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

self :

the SignonIdentity.

username :

username. [allow-none] -

secret :

secret. [allow-none] -

store_secret :

whether gSSO should save the password in secret storage.

methods :

allowed methods. [transfer none][element-type utf8 GStrv] -

caption :

caption. [allow-none] -

realms :

realms. [allow-none] -

owner :

owner. [allow-none] -

access_control_list :

access control list. [allow-none] -

type :

the type of the identity.

cb :

callback. [scope async] -

user_data :

user_data.
-
-
-
-

signon_identity_store_credentials_with_info ()

-
void                signon_identity_store_credentials_with_info
-                                                        (SignonIdentity *self,
-                                                         const SignonIdentityInfo *info,
-                                                         SignonIdentityStoreCredentialsCb cb,
-                                                         gpointer user_data);
-

-Stores the data contained in info into the identity record in the database. -See above for the detailed discussion of the meaning of various fields and -their defaults. -

-
-- - - - - - - - - - - - - - - - - - -

self :

the SignonIdentity.

info :

the SignonIdentityInfo data to store.

cb :

callback. [scope async] -

user_data :

user_data.
-
-
-
-

signon_identity_verify_secret ()

-
void                signon_identity_verify_secret       (SignonIdentity *self,
-                                                         const gchar *secret,
-                                                         SignonIdentityVerifyCb cb,
-                                                         gpointer user_data);
-

-Verifies the given secret. Not currently supported by gSSO. -

-
-- - - - - - - - - - - - - - - - - - -

self :

the SignonIdentity.

secret :

the secret (password) to be verified.

cb :

callback. [scope async] -

user_data :

user_data.
-
-
-
- - - \ No newline at end of file diff --git a/docs/reference/html/libgsignon-glib-objects.html b/docs/reference/html/libgsignon-glib-objects.html index 0eef979..53d92fa 100644 --- a/docs/reference/html/libgsignon-glib-objects.html +++ b/docs/reference/html/libgsignon-glib-objects.html @@ -2,37 +2,37 @@ -Part II. libgsignon-glib Objects - +libgsignon-glib Reference Manual: Part II. libgsignon-glib Objects + - + - - - - - - + + + + + +

Part II. libgsignon-glib Objects

Table of Contents

-
+
Object Hierarchy
Credential management
-SignonAuthService — the authorization service object +SignonAuthService — the authorization service object
-SignonIdentity — client side presentation of a credential. +SignonIdentity — client side presentation of a credential.
SignonIdentityInfo — data contained in a SignonIdentity. @@ -52,6 +52,6 @@
+ Generated by GTK-Doc V1.20
\ No newline at end of file diff --git a/docs/reference/html/libgsignon-glib-overview.html b/docs/reference/html/libgsignon-glib-overview.html index 1a27ab6..7c3682f 100644 --- a/docs/reference/html/libgsignon-glib-overview.html +++ b/docs/reference/html/libgsignon-glib-overview.html @@ -2,29 +2,29 @@ -Part I. gSSO Overview - +libgsignon-glib Reference Manual: Part I. gSSO Overview + - + - - - - - - + + + + + +

Part I. gSSO Overview

Table of Contents

-
+
gSSO introduction
@@ -36,6 +36,6 @@
+ Generated by GTK-Doc V1.20
\ No newline at end of file diff --git a/docs/reference/html/libgsignon-glib.devhelp2 b/docs/reference/html/libgsignon-glib.devhelp2 index dd85c5b..7f0b2b4 100644 --- a/docs/reference/html/libgsignon-glib.devhelp2 +++ b/docs/reference/html/libgsignon-glib.devhelp2 @@ -9,8 +9,8 @@ - - + + @@ -25,81 +25,99 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + @@ -111,63 +129,11 @@ - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/reference/html/object-tree.html b/docs/reference/html/object-tree.html index 1f7ba64..a0ac918 100644 --- a/docs/reference/html/object-tree.html +++ b/docs/reference/html/object-tree.html @@ -2,36 +2,38 @@ -Object Hierarchy - +libgsignon-glib Reference Manual: Object Hierarchy + - + - - - - - - + + + + + +

Object Hierarchy

     GObject
-        SignonAuthSession
+    ├── SignonAuthService
+    ├── SignonAuthSession
+    ╰── SignonIdentity
     GBoxed
-        SignonIdentityInfo
-        SignonSecurityContext
+    ├── SignonIdentityInfo
+    ╰── SignonSecurityContext
 
+ Generated by GTK-Doc V1.20
\ No newline at end of file diff --git a/docs/reference/html/right-insensitive.png b/docs/reference/html/right-insensitive.png new file mode 100644 index 0000000000000000000000000000000000000000..4c95785b907b978f36674cd98bf5302669c15c1b GIT binary patch literal 373 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefG`u!(zUX23=E7+o-U3d7N^fn+URvSL8NuRG*{E) z?#-+97X-^pidQ*u@StO1(S@7g8g>nnA24$?ty?)cmuaa|Y>ez2*_Ia?6HP4j{3LIs zTr!s1ao_Sz^~3e4zRJGAjKZGn=XP#)Wmuo-QN>teTzzI!&R*jMI^Oa#7_ukLYdicf zOx;1mb-rt04s-c|uIH8fnX}$)XJa^0_-F3(pA%=sGI<|(n_*&=yYt96+n5InXn_GN+EraJI9q(O+n{6MQKErp&KxRvpfn0xh z`sSMqH(2Z%?kaFBTf06W^y=UDA9gR9YrwNS*1pjB((0K%&+SbAx3`XA&dKZ}j*nX7 QfdRze>FVdQ&MBb@09|aA9{>OV literal 0 HcmV?d00001 diff --git a/docs/reference/html/right.png b/docs/reference/html/right.png index ed55207f1724d878d7f34739df09bc691de6ba5d..76260ec8865f4e13cd269ec62eccd78a33adba3c 100644 GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRMbR+#PqI2*V^#7sn8b(^oI8=W9$9IsUQVezxzH zy`G{eu0`y#boSlU-NAlQG~=D)BPJG4k(^0qdDa(AdQvI0d|vJT=i7_<_D6`Cy?Dm; zP0@1EeB~D|O$oQe*sxL-P;q{2UCr}fN-o#M~tpZzsGyfNz46SZlIJCbKH zZQscEqpOfBCPDgxEC zcoY;Al$DjWwY41_99FMhy?_7y!-o$aKYslD`Sb7JzX#g+Jp2n#J%dz9kY6wZ2akY= zgp7uXg@b!U^y=;V51+q${r=xGkihYWaF0)nSGL_~4v zsy0qpoBHoRx91b)PML#uY~Cl_6iIcwxhCq(b4!hn#|+g)^Yq0S-!v7Ec$2?7@@M^iZG`mTh716h@d}lb{2iURkP+kX3j17wd>EmBX&=u zvv*uDf3%l(&U^nZl`l8v@kwm9&20<|)bsLR{F2#{Ut#yhsr;NEk9fNJxvX C=EM*H diff --git a/docs/reference/html/style.css b/docs/reference/html/style.css index d6f6c26..705a5c9 100644 --- a/docs/reference/html/style.css +++ b/docs/reference/html/style.css @@ -1,15 +1,23 @@ +body +{ + font-family: cantarell, sans-serif; +} .synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; - border: solid 1px #d3d7cf; + background: rgba(238, 238, 236, 0.5); + border: solid 1px rgb(238, 238, 236); padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ + /* fallback for no rgba support */ background: #e6f3ff; border: solid 1px #729fcf; + background: rgba(114, 159, 207, 0.1); + border: solid 1px rgba(114, 159, 207, 0.2); padding: 0.5em; } .variablelist @@ -27,7 +35,6 @@ { position: relative; top: 0em ! important; - } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] @@ -46,16 +53,20 @@ */ body { - padding-top: 3.2em; - padding-bottom: 20em; + padding-top: 5em; + padding-bottom: 500px; + max-width: 60em; + } + p + { + max-width: 60em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; - /* tango:scarlet red 0/1 */ - background: #ffe6e6; - border: solid 1px #ef2929; + background: #e2e2e2; + border-bottom: solid 1px #babdb6; margin-top: 0; margin-bottom: 0; top: 0; @@ -65,21 +76,57 @@ } .navigation a, .navigation a:visited { - /* tango:scarlet red 3 */ - color: #a40000; + /* tango:sky blue 3 */ + color: #204a87; } .navigation a:hover { - /* tango:scarlet red 1 */ - color: #ef2929; + /* tango:sky blue 2 */ + color: #3465a4; } td.shortcuts { - /* tango:scarlet red 1 */ - color: #ef2929; + /* tango:sky blue 2 */ + color: #3465a4; font-size: 80%; white-space: nowrap; } + td.shortcuts .dim + { + color: #babdb6; + } +} +@media screen and (min-width: 60em) { + /* screen larger than 60em */ + body { margin: auto; } +} +@media screen and (max-width: 60em) { + /* screen less than 60em */ + #nav_hierarchy { display: none; } + #nav_interfaces { display: none; } + #nav_prerequisites { display: none; } + #nav_derived_interfaces { display: none; } + #nav_implementations { display: none; } + #nav_child_properties { display: none; } + #nav_style_properties { display: none; } + #nav_index { display: none; } + #nav_glossary { display: none; } + .gallery_image { display: none; } + .property_flags { display: none; } + .signal_flags { display: none; } + .parameter_annotations { display: none; } + .enum_member_annotations { display: none; } + .struct_member_annotations { display: none; } + .union_member_annotations { display: none; } + /* now that a column is hidden, optimize space */ + col.parameters_name { width: auto; } + col.parameters_description { width: auto; } + col.struct_members_name { width: auto; } + col.struct_members_description { width: auto; } + col.enum_members_name { width: auto; } + col.enum_members_description { width: auto; } + col.union_members_name { width: auto; } + col.union_members_description { width: auto; } } @media print { table.navigation { @@ -89,9 +136,8 @@ div.titlepage table.navigation { visibility: visible; display: table; - /* tango:scarlet red 0/1 */ - background: #ffe6e6; - border: solid 1px #ef2929; + background: #e2e2e2; + border: solid 1px #babdb6; margin-top: 0; margin-bottom: 0; top: 0; @@ -102,7 +148,7 @@ .navigation .title { - font-size: 200%; + font-size: 120%; } div.gallery-float @@ -132,6 +178,67 @@ a:hover color: #729fcf; } +div.informaltable table +{ + border-collapse: separate; + border-spacing: 20px 3px; + border: none; +} + +div.informaltable table td, div.informaltable table th +{ + vertical-align: top; +} + +.function_type, +.variable_type, +.property_type, +.signal_type, +.parameter_name, +.struct_member_name, +.union_member_name, +.define_keyword, +.datatype_keyword, +.typedef_keyword +{ + text-align: right; +} + +/* dim non-primary columns */ +.c_punctuation, +.function_type, +.variable_type, +.property_type, +.signal_type, +.define_keyword, +.datatype_keyword, +.typedef_keyword, +.property_flags, +.signal_flags, +.parameter_annotations, +.enum_member_annotations, +.struct_member_annotations, +.union_member_annotations +{ + color: #888a85; +} + +.function_type a, +.function_type a:visited, +.function_type a:hover, +.property_type a, +.property_type a:visited, +.property_type a:hover, +.signal_type a, +.signal_type a:visited, +.signal_type a:hover, +.signal_flags a, +.signal_flags a:visited, +.signal_flags a:hover +{ + color: #729fcf; +} + div.table table { border-collapse: collapse; @@ -154,14 +261,43 @@ div.table table th background-color: #d3d7cf; } +h4 +{ + color: #555753; +} + hr { - /* tango:aluminium 3 */ - color: #babdb6; - background: #babdb6; + /* tango:aluminium 1 */ + color: #d3d7cf; + background: #d3d7cf; border: none 0px; height: 1px; clear: both; + margin: 2.0em 0em 2.0em 0em; +} + +dl.toc dt +{ + padding-bottom: 0.25em; +} + +dl.toc > dd > dl > dt +{ + padding-top: 0.25em; + padding-bottom: 0.25em; +} + +dl.toc > dt +{ + padding-top: 1em; + padding-bottom: 0.5em; + font-weight: bold; +} + +.parameter +{ + font-style: normal; } .footer @@ -173,31 +309,70 @@ hr font-size: 80%; } +.informalfigure, +.figure +{ + margin: 1em; +} + +.informalexample, +.example +{ + margin-top: 1em; + margin-bottom: 1em; +} + .warning { /* tango:orange 0/1 */ background: #ffeed9; + background: rgba(252, 175, 62, 0.1); border-color: #ffb04f; + border-color: rgba(252, 175, 62, 0.2); } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; + background: rgba(138, 226, 52, 0.1); border-color: #abf562; + border-color: rgba(138, 226, 52, 0.2); } -.note, .warning +div.blockquote +{ + border-color: #eeeeec; +} +.note, .warning, div.blockquote { padding: 0.5em; border-width: 1px; border-style: solid; + margin: 2em; } -.note h3, .warning h3 +.note p, .warning p { - margin-top: 0.0em + margin: 0; } -.note p, .warning p + +div.warning h3.title, +div.note h3.title { - margin-bottom: 0.0em + display: none; +} + +p + div.section +{ + margin-top: 1em; +} + +div.refnamediv, +div.refsynopsisdiv, +div.refsect1, +div.refsect2, +div.toc, +div.section +{ + margin-bottom: 1em; } /* blob links */ @@ -210,11 +385,22 @@ h2 .extralinks, h3 .extralinks font-weight: normal; } +.lineart +{ + color: #d3d7cf; + font-weight: normal; +} + .annotation { /* tango:aluminium 5 */ color: #555753; - font-size: 80%; + font-weight: normal; +} + +.structfield +{ + font-style: normal; font-weight: normal; } @@ -237,6 +423,7 @@ h2 .extralinks, h3 .extralinks .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; + border: solid 1px rgba(114, 159, 207, 0.2); padding: 0px; } @@ -246,19 +433,27 @@ h2 .extralinks, h3 .extralinks padding: 0.5em; } .listing_lines { + /* this just adds visual clutter and + takes precious room from small screens */ + display: none; +} +.listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; + background: rgba(114, 159, 207, 0.2); /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; + background: rgba(114, 159, 207, 0.1); } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; + background: none; } .listing_lines pre, .listing_code pre { margin: 0px; diff --git a/docs/reference/html/up-insensitive.png b/docs/reference/html/up-insensitive.png new file mode 100644 index 0000000000000000000000000000000000000000..f40498606db349a7321cf6b470523e836ee7ac2e GIT binary patch literal 374 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefG~@Ex#w@70gTL^E{-7zACwHGSRJaopUzr*FR_KPpkxheNzTDP+%{a~ox zRb6~e-_l%s#;V|Jw-)bO$G_X=4F`Y7SBoCzyjAZQ8BPW>ywAP8?pbBsZ|wt?+h6S6&uqY)kkMnwQQEd@7k`4t@sCCO z@7MoiEI4Q_#IB70vhu7Ab+>SXLxu@LWH Qzz|~aboFyt=akR{08E^fv;Y7A literal 0 HcmV?d00001 diff --git a/docs/reference/html/up.png b/docs/reference/html/up.png index 8eb591f3b8d09f472b1d32c003da9647394a3823..80b4b37e997d69b2e128bc3090bc447ccb74bbe9 100644 GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHjTefRFevZLys@4W>+6GUE!tU04Ii{0w_tkMIDB?rA5 zttYTN~)ovO&!Y#`Dmc%rM5 zQ$@(ou+gP}oo|CI>vraXhEtsWyWLqh`I+o4O4_JnaHZ1HsZSD%fxx signon-auth-service SignonAuthService +SignonAuthService SignonAuthServiceClass SignonIdentityFilter SignonIdentityList @@ -42,6 +43,7 @@ SignonSessionDataUiPolicy signon_auth_session_cancel signon_auth_session_get_method signon_auth_session_new +signon_auth_session_new_for_identity signon_auth_session_process signon_auth_session_process_async signon_auth_session_process_finish @@ -72,6 +74,7 @@ signon_error_quark
signon-identity SignonIdentity +SignonIdentity SignonIdentityClass SignonIdentityInfoCb SignonIdentityReferenceAddedCb @@ -88,6 +91,8 @@ signon_identity_get_auth_session signon_identity_get_last_error signon_identity_new signon_identity_new_from_db +signon_identity_new_with_context +signon_identity_new_with_context_from_db signon_identity_query_info signon_identity_remove signon_identity_remove_reference @@ -123,6 +128,7 @@ signon_identity_info_get_realms signon_identity_info_get_storing_secret signon_identity_info_get_username signon_identity_info_new +signon_identity_info_own_methods signon_identity_info_remove_method signon_identity_info_set_access_control_list signon_identity_info_set_caption diff --git a/examples/gsso-example.c b/examples/gsso-example.c index 8850f81..072ebf6 100644 --- a/examples/gsso-example.c +++ b/examples/gsso-example.c @@ -26,6 +26,11 @@ #include "libgsignon-glib/signon-auth-service.h" #include "libgsignon-glib/signon-identity.h" +typedef struct { + GMainLoop *main_loop; + SignonSecurityContext *security_context; +} AclModifyUserData; + static void signon_query_methods_cb (SignonAuthService *auth_service, gchar **methods, const GError *error, gpointer user_data) @@ -118,10 +123,18 @@ static void signon_query_identities_cb (SignonAuthService *auth_service, SignonIdentityInfo *info = (SignonIdentityInfo *) iter->data; const gchar *caption = signon_identity_info_get_caption (info); - g_print ("\tid=%d caption='%s'\n", + g_print ("\tid=%d caption='%s' ACL:", signon_identity_info_get_id (info), signon_identity_info_get_caption (info)); + SignonSecurityContextList *acl = signon_identity_info_get_access_control_list(info); + for(acl = g_list_first(acl); acl != NULL; acl = g_list_next(acl)) { + const SignonSecurityContext *context = acl->data; + g_print(" (%s:%s)", signon_security_context_get_system_context(context), + signon_security_context_get_application_context(context)); + } + g_print("\n"); + iter = g_list_next (iter); } g_list_free_full (identity_list, (GDestroyNotify)signon_identity_info_free); @@ -159,17 +172,23 @@ static void signon_store_identity_cb(SignonIdentity *self, } static void create_auth_identity(GMainLoop* main_loop, const gchar* identity_caption, - const gchar* identity_method) + const gchar* identity_method, const gchar* allowed_realms) { const gchar* all_mechanisms[] = { "*", NULL }; - SignonIdentity* identity = signon_identity_new(NULL); + SignonIdentity* identity = signon_identity_new(); SignonIdentityInfo* identity_info = signon_identity_info_new(); signon_identity_info_set_caption(identity_info, identity_caption); signon_identity_info_set_method(identity_info, identity_method, all_mechanisms); if (g_strcmp0(identity_method, "password") == 0) signon_identity_info_set_secret(identity_info, NULL, TRUE); + if (allowed_realms != NULL) { + gchar** realms_array = g_strsplit(allowed_realms, ",", 0); + signon_identity_info_set_realms(identity_info, (const gchar* const *) realms_array); + g_strfreev(realms_array); + } + signon_identity_store_credentials_with_info (identity, identity_info, signon_store_identity_cb, @@ -198,7 +217,7 @@ static void signon_remove_identity_cb(SignonIdentity *self, static void remove_auth_identity(GMainLoop* main_loop, gint identity_id) { - SignonIdentity* identity = signon_identity_new_from_db(identity_id, NULL); + SignonIdentity* identity = signon_identity_new_from_db(identity_id); signon_identity_remove (identity, signon_remove_identity_cb, main_loop); @@ -244,7 +263,7 @@ static void get_google_token(GMainLoop* main_loop, gint identity_id, exit(1); } - SignonIdentity* identity = signon_identity_new_from_db(identity_id, NULL); + SignonIdentity* identity = signon_identity_new_from_db(identity_id); SignonAuthSession* session = signon_identity_create_session(identity, "oauth", NULL); GVariantBuilder builder; @@ -290,7 +309,7 @@ static void get_google_token(GMainLoop* main_loop, gint identity_id, static void get_password(GMainLoop* main_loop, gint identity_id) { - SignonIdentity* identity = signon_identity_new_from_db(identity_id, NULL); + SignonIdentity* identity = signon_identity_new_from_db(identity_id); SignonAuthSession* session = signon_identity_create_session(identity, "password", NULL); GVariantBuilder builder; @@ -312,6 +331,96 @@ static void get_password(GMainLoop* main_loop, gint identity_id) g_object_unref(identity); } +static void append_acl_cb(SignonIdentity *self, SignonIdentityInfo *info, const GError *error, gpointer user_data) +{ + AclModifyUserData *am_user_data = (AclModifyUserData *)user_data; + SignonIdentityInfo *new_info; + + if (error) { + g_warning("%s: %s", G_STRFUNC, error->message); + goto clean_user_data; + } + + new_info = signon_identity_info_copy(info); + signon_identity_info_access_control_list_append(new_info, am_user_data->security_context); + signon_identity_store_credentials_with_info(self, new_info, signon_store_identity_cb, am_user_data->main_loop); + signon_identity_info_free(new_info); + +clean_user_data: + g_free(am_user_data); +} + +static void append_acl(GMainLoop* main_loop, gint identity_id, SignonSecurityContext* security_context) +{ + AclModifyUserData *user_data = g_new0(AclModifyUserData, 1); + user_data->main_loop = main_loop; + user_data->security_context = security_context; + + SignonIdentity* identity = signon_identity_new_from_db(identity_id); + signon_identity_query_info(identity, append_acl_cb, user_data); + + g_main_loop_run (main_loop); + g_object_unref(identity); +} + +static void remove_acl_cb(SignonIdentity *self, SignonIdentityInfo *info, const GError *error, gpointer user_data) +{ + AclModifyUserData *am_user_data = (AclModifyUserData *)user_data; + + if (error) { + g_warning("%s: %s", G_STRFUNC, error->message); + goto clean_user_data; + } + + SignonSecurityContextList *new_list = signon_security_context_list_copy(signon_identity_info_get_access_control_list(info)); + SignonSecurityContextList *list_iter = new_list; + + gboolean list_changed = FALSE; + while(list_iter != NULL) { + SignonSecurityContext *curr_context = list_iter->data; + if (g_strcmp0(signon_security_context_get_system_context(curr_context), am_user_data->security_context->sys_ctx) == 0 + && g_strcmp0(signon_security_context_get_application_context(curr_context), am_user_data->security_context->app_ctx) == 0) { + signon_security_context_free(curr_context); + new_list = g_list_remove_link(new_list, list_iter); + list_changed = TRUE; + break; + } + list_iter = g_list_next(list_iter); + } + + if (list_changed) { + signon_identity_info_set_access_control_list(info, new_list); + signon_identity_store_credentials_with_info(self, info, signon_store_identity_cb, am_user_data->main_loop); + } else { + signon_security_context_list_free(new_list); + g_main_loop_quit (am_user_data->main_loop); + } + +clean_user_data: + signon_security_context_free(am_user_data->security_context); + g_free(am_user_data); +} + +static void remove_acl(GMainLoop* main_loop, gint identity_id, SignonSecurityContext* security_context) +{ + AclModifyUserData *am_user_data = g_new0(AclModifyUserData, 1); + am_user_data->main_loop = main_loop; + am_user_data->security_context = security_context; + + SignonIdentity* identity = signon_identity_new_from_db(identity_id); + signon_identity_query_info(identity, remove_acl_cb, am_user_data); + + g_main_loop_run (main_loop); + g_object_unref(identity); +} + +SignonSecurityContext *create_security_context_from_args(const gchar *sys_ctx, const gchar *app_ctx) { + if (sys_ctx && app_ctx) { + return signon_security_context_new_from_values(sys_ctx, app_ctx); + } + return NULL; +} + int main (int argc, char *argv[]) { @@ -325,6 +434,7 @@ main (int argc, char *argv[]) gboolean query_identities = FALSE; gchar* create_identity_caption = NULL; gchar* create_identity_method = NULL; + gchar* create_identity_realms = NULL; gint remove_identity_id = 0; GOptionEntry main_entries[] = @@ -334,6 +444,7 @@ main (int argc, char *argv[]) { "query-identities", 0, 0, G_OPTION_ARG_NONE, &query_identities, "Query available authentication identities", NULL}, { "create-identity", 0, 0, G_OPTION_ARG_STRING, &create_identity_caption, "Create a new authentication identity", "caption"}, { "identity-method", 0, 0, G_OPTION_ARG_STRING, &create_identity_method, "Method to use when creating identity", "method"}, + { "identity-realms", 0, 0, G_OPTION_ARG_STRING, &create_identity_realms, "A comma-separated list of allowed realms for the identity", "realms"}, { "remove-identity", 0, 0, G_OPTION_ARG_INT, &remove_identity_id, "Remove an authentication identity", "id"}, { NULL } }; @@ -357,6 +468,20 @@ main (int argc, char *argv[]) { "get-password", 0, 0, G_OPTION_ARG_INT, &password_identity_id, "Get an identity's username and password using 'password' plugin", "identity-id"}, { NULL } }; + + gint add_acl_ctx_id = 0; + gint remove_acl_ctx_id = 0; + gchar *acl_sys_ctx = NULL; + gchar *acl_app_ctx = NULL; + + GOptionEntry acl_entries[] = + { + { "add-context", 0, 0, G_OPTION_ARG_INT, &add_acl_ctx_id, "Add security context to identity", "identity-id"}, + { "remove-context", 0, 0, G_OPTION_ARG_INT, &remove_acl_ctx_id, "Remove security context from identity", "identity-id"}, + { "system-context", 0, 0, G_OPTION_ARG_STRING, &acl_sys_ctx, "System context", "system-context"}, + { "application-context", 0, 0, G_OPTION_ARG_STRING, &acl_app_ctx, "Application context", "application-context"}, + { NULL } + }; #if !GLIB_CHECK_VERSION (2, 36, 0) @@ -372,6 +497,10 @@ main (int argc, char *argv[]) GOptionGroup* password_group = g_option_group_new("password", "Password-specific options", "Password-specific options", NULL, NULL); g_option_group_add_entries(password_group, password_entries); g_option_context_add_group (context, password_group); + + GOptionGroup* acl_group = g_option_group_new("acl", "ACL-specific options", "ACL-specific options", NULL, NULL); + g_option_group_add_entries(acl_group, acl_entries); + g_option_context_add_group (context, acl_group); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_print ("option parsing failed: %s\n", error->message); @@ -389,13 +518,24 @@ main (int argc, char *argv[]) } else if (query_identities) { query_auth_identities(main_loop); } else if (create_identity_caption) { - create_auth_identity(main_loop, create_identity_caption, create_identity_method); + create_auth_identity(main_loop, create_identity_caption, create_identity_method, create_identity_realms); } else if (remove_identity_id > 0) { remove_auth_identity(main_loop, remove_identity_id); } else if (google_identity_id > 0) { get_google_token(main_loop, google_identity_id, client_id, client_secret); } else if (password_identity_id > 0) { get_password(main_loop, password_identity_id); + } else if (add_acl_ctx_id > 0 || remove_acl_ctx_id) { + SignonSecurityContext *sec_ctx = create_security_context_from_args(acl_sys_ctx, acl_app_ctx); + if (sec_ctx) { + if (add_acl_ctx_id > 0) { + append_acl(main_loop, add_acl_ctx_id, sec_ctx); + } else { + remove_acl(main_loop, remove_acl_ctx_id, sec_ctx); + } + } else { + g_print("Must provide security context with --system-context and --application-context options\n"); + } } g_main_loop_unref(main_loop); @@ -407,6 +547,12 @@ main (int argc, char *argv[]) g_free(query_mechanisms_method); if (create_identity_caption) g_free(create_identity_caption); - if (create_identity_caption) + if (create_identity_method) g_free(create_identity_method); + if (create_identity_realms) + g_free(create_identity_realms); + if (acl_sys_ctx) + g_free(acl_sys_ctx); + if (acl_app_ctx) + g_free(acl_app_ctx); } diff --git a/libgsignon-glib/Makefile.am b/libgsignon-glib/Makefile.am index b27d525..5cb8437 100644 --- a/libgsignon-glib/Makefile.am +++ b/libgsignon-glib/Makefile.am @@ -6,6 +6,7 @@ libgsignon_glib_la_CPPFLAGS = \ -I$(srcdir) \ -I$(top_builddir) \ -I$(builddir) \ + -I$(top_srcdir)/libgsignon-glib \ $(DEPS_CFLAGS) \ -Wall -Werror libgsignon_glib_la_LIBADD = $(DEPS_LIBS) @@ -13,26 +14,7 @@ libgsignon_glib_la_LDFLAGS = \ -version-info 1:0:0 \ -export-symbols-regex '^signon_' -nodist_libgsignon_glib_la_SOURCES = \ - signon-marshal.c \ - signon-marshal.h \ - signon-enum-types.h \ - signon-enum-types.c \ - signon-errors-enum.c \ - sso-auth-service-gen.c \ - sso-auth-service-gen.h \ - sso-auth-session-gen.c \ - sso-auth-session-gen.h \ - sso-identity-gen.c \ - sso-identity-gen.h \ - stamp-signon-enum-types.h - -BUILT_SOURCES = \ - $(nodist_libgsignon_glib_la_SOURCES) \ - signon-errors-map.c - CLEANFILES = \ - $(BUILT_SOURCES) \ sso-auth-service-gen-doc-com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml \ sso-auth-session-gen-doc-com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml \ sso-identity-gen-doc-com.google.code.AccountsSSO.gSingleSignOn.Identity.xml @@ -57,7 +39,20 @@ libgsignon_glib_la_SOURCES = \ signon-security-context.h \ signon-security-context.c \ sso-auth-service.c \ - sso-auth-service.h + sso-auth-service.h \ + signon-marshal.c \ + signon-marshal.h \ + signon-enum-types.h \ + signon-enum-types.c \ + signon-errors-enum.c \ + sso-auth-service-gen.c \ + sso-auth-service-gen.h \ + sso-auth-session-gen.c \ + sso-auth-session-gen.h \ + sso-identity-gen.c \ + sso-identity-gen.h \ + stamp-signon-enum-types.h \ + signon-errors-map.c libgsignon_glib_includedir = $(includedir)/libgsignon-glib libgsignon_glib_include_HEADERS = \ @@ -82,84 +77,6 @@ libgsignon_glib_headers_with_enums = \ # default is /usr/share/dbus-1/interfaces INTERFACES_DIR = $(top_srcdir)/libgsignon-glib/interfaces -sso-auth-service-gen.h sso-auth-service-gen.c: $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml - $(AM_V_GEN)gdbus-codegen \ - --generate-c-code sso-auth-service-gen \ - --generate-docbook sso-auth-service-gen-doc \ - --annotate "com.google.code.AccountsSSO.gSingleSignOn.AuthService" org.gtk.GDBus.C.Name SsoAuthService \ - $< - -sso-auth-session-gen.h sso-auth-session-gen.c: $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml - $(AM_V_GEN)gdbus-codegen \ - --generate-c-code sso-auth-session-gen \ - --generate-docbook sso-auth-session-gen-doc \ - --annotate "com.google.code.AccountsSSO.gSingleSignOn.AuthSession" org.gtk.GDBus.C.Name SsoAuthSession \ - $< - -sso-identity-gen.h sso-identity-gen.c: $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml - $(AM_V_GEN)gdbus-codegen \ - --generate-c-code sso-identity-gen \ - --generate-docbook sso-identity-gen-doc \ - --annotate "com.google.code.AccountsSSO.gSingleSignOn.Identity" org.gtk.GDBus.C.Name SsoIdentity \ - $< - -signon-marshal.h: signon-marshal.list Makefile - $(AM_V_GEN)glib-genmarshal --header --prefix=_signon_marshal $< > $@ - -signon-marshal.c: signon-marshal.list Makefile - $(AM_V_GEN)glib-genmarshal --body --prefix=_signon_marshal $< > $@ - -signon-enum-types.h: stamp-signon-enum-types.h - $(AM_V_at)true - -stamp-signon-enum-types.h: Makefile \ - $(libgsignon_glib_headers_with_enums) signon-errors.h - $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ - --fhead "#ifndef __SIGNON_ENUM_TYPES_H__\n#define __SIGNON_ENUM_TYPES_H__\n#include \n\nG_BEGIN_DECLS\n" \ - --fprod "/* enumerations from \"@filename@\" */\n" \ - --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define SIGNON_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ - --ftail "G_END_DECLS\n\n#endif /* __SIGNON_ENUM_TYPES_H__ */" \ - $(libgsignon_glib_headers_with_enums) signon-errors.h ) >> stamp-xgen-geth \ - && (cmp -s stamp-xgen-geth signon-enum-types.h || cp stamp-xgen-geth signon-enum-types.h ) \ - && rm -f stamp-xgen-geth \ - && echo timestamp > $(@F) - -signon-enum-types.c: Makefile $(libgsignon_glib_headers_with_enums) - $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ - --fhead "#include \"signon-enum-types.h\"\n" \ - --fhead "#include \"signon-identity-info.h\"\n" \ - --fhead "#include \"signon-auth-session.h\"\n" \ - --fhead "#define g_intern_static_string(s) (s)\n" \ - --fprod "\n/* enumerations from \"@filename@\" */" \ - --ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \ - --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ - --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ - --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \ - $(libgsignon_glib_headers_with_enums) ) > enum-xgen-getc \ - && cp enum-xgen-getc signon-enum-types.c \ - && rm -f enum-xgen-getc - -signon-errors-enum.c: Makefile signon-errors.h - $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ - --fhead "#include \"signon-enum-types.h\"\n#include \"signon-errors.h\"\n#include \"signon-internals.h\"\n#define g_intern_static_string(s) (s)\n" \ - --fprod "\n/* enumerations from \"@filename@\" */" \ - --ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \ - --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ - --vprod " { @VALUENAME@, SED@VALUENAME@, \"@valuenick@\" }," \ - --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \ - signon-errors.h ) | \ - $(SED) -e 's/SEDSIGNON_ERROR_\([^,]*\)/SIGNOND_\1_ERR_NAME/' \ - > errors-xgen-getc \ - && cp errors-xgen-getc signon-errors-enum.c \ - && rm -f errors-xgen-getc - -signon-errors-map.c: Makefile signon-errors.h - $(AM_V_GEN)( cd $(srcdir) && \ - echo "static const GDBusErrorEntry signon_error_entries[] = {" && \ - grep "^ *SIGNON_ERROR_" signon-errors.h | \ - $(SED) -e 's/SIGNON_ERROR_\([A-Z_0-9]*\).*/{ SIGNON_ERROR_\1, SIGNOND_\1_ERR_NAME },/' && \ - echo -e "};\n" ) > signon-errors-map.c - dist_noinst_DATA = \ signon-marshal.list \ stamp-signon-enum-types.h diff --git a/libgsignon-glib/Makefile.in b/libgsignon-glib/Makefile.in index db48f5d..5cf4fa1 100644 --- a/libgsignon-glib/Makefile.in +++ b/libgsignon-glib/Makefile.in @@ -96,16 +96,15 @@ am_libgsignon_glib_la_OBJECTS = \ libgsignon_glib_la-signon-errors.lo \ libgsignon_glib_la-signon-utils.lo \ libgsignon_glib_la-signon-security-context.lo \ - libgsignon_glib_la-sso-auth-service.lo -nodist_libgsignon_glib_la_OBJECTS = \ + libgsignon_glib_la-sso-auth-service.lo \ libgsignon_glib_la-signon-marshal.lo \ libgsignon_glib_la-signon-enum-types.lo \ libgsignon_glib_la-signon-errors-enum.lo \ libgsignon_glib_la-sso-auth-service-gen.lo \ libgsignon_glib_la-sso-auth-session-gen.lo \ - libgsignon_glib_la-sso-identity-gen.lo -libgsignon_glib_la_OBJECTS = $(am_libgsignon_glib_la_OBJECTS) \ - $(nodist_libgsignon_glib_la_OBJECTS) + libgsignon_glib_la-sso-identity-gen.lo \ + libgsignon_glib_la-signon-errors-map.lo +libgsignon_glib_la_OBJECTS = $(am_libgsignon_glib_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -139,8 +138,7 @@ am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libgsignon_glib_la_SOURCES) \ - $(nodist_libgsignon_glib_la_SOURCES) +SOURCES = $(libgsignon_glib_la_SOURCES) DIST_SOURCES = $(libgsignon_glib_la_SOURCES) DATA = $(dbusinterfaces_DATA) $(dist_noinst_DATA) $(gir_DATA) \ $(typelib_DATA) @@ -303,6 +301,7 @@ libgsignon_glib_la_CPPFLAGS = \ -I$(srcdir) \ -I$(top_builddir) \ -I$(builddir) \ + -I$(top_srcdir)/libgsignon-glib \ $(DEPS_CFLAGS) \ -Wall -Werror @@ -311,26 +310,7 @@ libgsignon_glib_la_LDFLAGS = \ -version-info 1:0:0 \ -export-symbols-regex '^signon_' -nodist_libgsignon_glib_la_SOURCES = \ - signon-marshal.c \ - signon-marshal.h \ - signon-enum-types.h \ - signon-enum-types.c \ - signon-errors-enum.c \ - sso-auth-service-gen.c \ - sso-auth-service-gen.h \ - sso-auth-session-gen.c \ - sso-auth-session-gen.h \ - sso-identity-gen.c \ - sso-identity-gen.h \ - stamp-signon-enum-types.h - -BUILT_SOURCES = \ - $(nodist_libgsignon_glib_la_SOURCES) \ - signon-errors-map.c - -CLEANFILES = $(BUILT_SOURCES) \ - sso-auth-service-gen-doc-com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml \ +CLEANFILES = sso-auth-service-gen-doc-com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml \ sso-auth-session-gen-doc-com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml \ sso-identity-gen-doc-com.google.code.AccountsSSO.gSingleSignOn.Identity.xml \ $(am__append_2) @@ -354,7 +334,20 @@ libgsignon_glib_la_SOURCES = \ signon-security-context.h \ signon-security-context.c \ sso-auth-service.c \ - sso-auth-service.h + sso-auth-service.h \ + signon-marshal.c \ + signon-marshal.h \ + signon-enum-types.h \ + signon-enum-types.c \ + signon-errors-enum.c \ + sso-auth-service-gen.c \ + sso-auth-service-gen.h \ + sso-auth-session-gen.c \ + sso-auth-session-gen.h \ + sso-identity-gen.c \ + sso-identity-gen.h \ + stamp-signon-enum-types.h \ + signon-errors-map.c libgsignon_glib_includedir = $(includedir)/libgsignon-glib libgsignon_glib_include_HEADERS = \ @@ -427,8 +420,7 @@ dbusinterfaces_DATA = \ $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml EXTRA_DIST = interfaces -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am +all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj @@ -507,6 +499,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignon_glib_la-signon-dbus-queue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignon_glib_la-signon-enum-types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignon_glib_la-signon-errors-enum.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignon_glib_la-signon-errors-map.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignon_glib_la-signon-errors.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignon_glib_la-signon-identity-info.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgsignon_glib_la-signon-identity.Plo@am__quote@ @@ -647,6 +640,13 @@ libgsignon_glib_la-sso-identity-gen.lo: sso-identity-gen.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignon_glib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignon_glib_la-sso-identity-gen.lo `test -f 'sso-identity-gen.c' || echo '$(srcdir)/'`sso-identity-gen.c +libgsignon_glib_la-signon-errors-map.lo: signon-errors-map.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignon_glib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgsignon_glib_la-signon-errors-map.lo -MD -MP -MF $(DEPDIR)/libgsignon_glib_la-signon-errors-map.Tpo -c -o libgsignon_glib_la-signon-errors-map.lo `test -f 'signon-errors-map.c' || echo '$(srcdir)/'`signon-errors-map.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgsignon_glib_la-signon-errors-map.Tpo $(DEPDIR)/libgsignon_glib_la-signon-errors-map.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='signon-errors-map.c' object='libgsignon_glib_la-signon-errors-map.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgsignon_glib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgsignon_glib_la-signon-errors-map.lo `test -f 'signon-errors-map.c' || echo '$(srcdir)/'`signon-errors-map.c + mostlyclean-libtool: -rm -f *.lo @@ -808,15 +808,13 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am +check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(dbusinterfacesdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(typelibdir)" "$(DESTDIR)$(libgsignon_glib_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am +install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -847,7 +845,6 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ @@ -922,7 +919,7 @@ uninstall-am: uninstall-dbusinterfacesDATA uninstall-girDATA \ uninstall-libLTLIBRARIES \ uninstall-libgsignon_glib_includeHEADERS uninstall-typelibDATA -.MAKE: all check install install-am install-strip +.MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ @@ -943,84 +940,6 @@ uninstall-am: uninstall-dbusinterfacesDATA uninstall-girDATA \ uninstall-libgsignon_glib_includeHEADERS uninstall-typelibDATA -sso-auth-service-gen.h sso-auth-service-gen.c: $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthService.xml - $(AM_V_GEN)gdbus-codegen \ - --generate-c-code sso-auth-service-gen \ - --generate-docbook sso-auth-service-gen-doc \ - --annotate "com.google.code.AccountsSSO.gSingleSignOn.AuthService" org.gtk.GDBus.C.Name SsoAuthService \ - $< - -sso-auth-session-gen.h sso-auth-session-gen.c: $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.AuthSession.xml - $(AM_V_GEN)gdbus-codegen \ - --generate-c-code sso-auth-session-gen \ - --generate-docbook sso-auth-session-gen-doc \ - --annotate "com.google.code.AccountsSSO.gSingleSignOn.AuthSession" org.gtk.GDBus.C.Name SsoAuthSession \ - $< - -sso-identity-gen.h sso-identity-gen.c: $(INTERFACES_DIR)/com.google.code.AccountsSSO.gSingleSignOn.Identity.xml - $(AM_V_GEN)gdbus-codegen \ - --generate-c-code sso-identity-gen \ - --generate-docbook sso-identity-gen-doc \ - --annotate "com.google.code.AccountsSSO.gSingleSignOn.Identity" org.gtk.GDBus.C.Name SsoIdentity \ - $< - -signon-marshal.h: signon-marshal.list Makefile - $(AM_V_GEN)glib-genmarshal --header --prefix=_signon_marshal $< > $@ - -signon-marshal.c: signon-marshal.list Makefile - $(AM_V_GEN)glib-genmarshal --body --prefix=_signon_marshal $< > $@ - -signon-enum-types.h: stamp-signon-enum-types.h - $(AM_V_at)true - -stamp-signon-enum-types.h: Makefile \ - $(libgsignon_glib_headers_with_enums) signon-errors.h - $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ - --fhead "#ifndef __SIGNON_ENUM_TYPES_H__\n#define __SIGNON_ENUM_TYPES_H__\n#include \n\nG_BEGIN_DECLS\n" \ - --fprod "/* enumerations from \"@filename@\" */\n" \ - --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define SIGNON_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ - --ftail "G_END_DECLS\n\n#endif /* __SIGNON_ENUM_TYPES_H__ */" \ - $(libgsignon_glib_headers_with_enums) signon-errors.h ) >> stamp-xgen-geth \ - && (cmp -s stamp-xgen-geth signon-enum-types.h || cp stamp-xgen-geth signon-enum-types.h ) \ - && rm -f stamp-xgen-geth \ - && echo timestamp > $(@F) - -signon-enum-types.c: Makefile $(libgsignon_glib_headers_with_enums) - $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ - --fhead "#include \"signon-enum-types.h\"\n" \ - --fhead "#include \"signon-identity-info.h\"\n" \ - --fhead "#include \"signon-auth-session.h\"\n" \ - --fhead "#define g_intern_static_string(s) (s)\n" \ - --fprod "\n/* enumerations from \"@filename@\" */" \ - --ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \ - --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ - --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ - --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \ - $(libgsignon_glib_headers_with_enums) ) > enum-xgen-getc \ - && cp enum-xgen-getc signon-enum-types.c \ - && rm -f enum-xgen-getc - -signon-errors-enum.c: Makefile signon-errors.h - $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ - --fhead "#include \"signon-enum-types.h\"\n#include \"signon-errors.h\"\n#include \"signon-internals.h\"\n#define g_intern_static_string(s) (s)\n" \ - --fprod "\n/* enumerations from \"@filename@\" */" \ - --ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \ - --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ - --vprod " { @VALUENAME@, SED@VALUENAME@, \"@valuenick@\" }," \ - --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \ - signon-errors.h ) | \ - $(SED) -e 's/SEDSIGNON_ERROR_\([^,]*\)/SIGNOND_\1_ERR_NAME/' \ - > errors-xgen-getc \ - && cp errors-xgen-getc signon-errors-enum.c \ - && rm -f errors-xgen-getc - -signon-errors-map.c: Makefile signon-errors.h - $(AM_V_GEN)( cd $(srcdir) && \ - echo "static const GDBusErrorEntry signon_error_entries[] = {" && \ - grep "^ *SIGNON_ERROR_" signon-errors.h | \ - $(SED) -e 's/SIGNON_ERROR_\([A-Z_0-9]*\).*/{ SIGNON_ERROR_\1, SIGNOND_\1_ERR_NAME },/' && \ - echo -e "};\n" ) > signon-errors-map.c - -include $(INTROSPECTION_MAKEFILE) @HAVE_INTROSPECTION_TRUE@gSignon-1.0.gir: libgsignon-glib.la diff --git a/libgsignon-glib/signon-auth-session.c b/libgsignon-glib/signon-auth-session.c index 805aac1..19ad642 100644 --- a/libgsignon-glib/signon-auth-session.c +++ b/libgsignon-glib/signon-auth-session.c @@ -5,7 +5,7 @@ * * Copyright (C) 2009-2010 Nokia Corporation. * Copyright (C) 2012 Canonical Ltd. - * Copyright (C) 2012-2013 Intel Corporation. + * Copyright (C) 2012-2014 Intel Corporation. * * Contact: Alberto Mardegan * Contact: Jussi Laako @@ -33,8 +33,7 @@ * The #SignonAuthSession object is responsible for handling the client * authentication. #SignonAuthSession objects should be created from existing * identities (via signon_identity_create_session() or by passing a non-NULL identity - * to signon_auth_session_new()), in which case the authentication data such as - * username and password will be implicitly taken from the identity. + * to signon_auth_session_new()). */ #include "signon-internals.h" @@ -380,8 +379,10 @@ signon_auth_session_class_init (SignonAuthSessionClass *klass) * @state: the current state of the #SignonAuthSession * @message: the message associated with the state change * - * Emitted when the state of the #SignonAuthSession changes. - * FIXME: @state should be registered as a GLib type (or use one from + * Emitted when the state of the #SignonAuthSession changes. The state change + * is initiated by #GSignondPlugin via #GSignondPlugin::status-changed signal. + */ + /* FIXME: @state should be registered as a GLib type (or use one from * libgsignond-common) */ auth_session_signals[STATE_CHANGED] = @@ -402,7 +403,8 @@ signon_auth_session_class_init (SignonAuthSessionClass *klass) /** * signon_auth_session_new: - * @parent: #SignonIdentity parent object. + * @id: the id of the #SignonIdentity to be used. Can be 0, if this session is + * not bound to any stored identity. * @method_name: the name of the authentication method to be used. * @err: a pointer to a location which will contain the error, in case this * function fails. @@ -413,19 +415,41 @@ signon_auth_session_class_init (SignonAuthSessionClass *klass) * Returns: a new #SignonAuthSession. */ SignonAuthSession * -signon_auth_session_new (GObject *parent, +signon_auth_session_new (gint id, const gchar *method_name, GError **err) { - if (!SIGNON_IS_IDENTITY(parent)) - { - g_set_error (err, - signon_error_quark(), - SIGNON_ERROR_UNKNOWN, - "Parent object is wrong type"); - return NULL; - } - SignonIdentity *identity = SIGNON_IDENTITY(parent); + DEBUG ("%s %d", G_STRFUNC, __LINE__); + + SignonIdentity *identity = (id == 0) ? + signon_identity_new () : signon_identity_new_from_db (id); + g_return_val_if_fail (identity, NULL); + + SignonAuthSession *self = + signon_auth_session_new_for_identity (identity, method_name, err); + g_object_unref (identity); + + return self; +} + +/** + * signon_auth_session_new_for_identity: + * @identity: #SignonIdentity parent object. + * @method_name: the name of the authentication method to be used. + * @err: a pointer to a location which will contain the error, in case this + * function fails. + * + * Creates a new #SignonAuthSession, which can be used to authenticate using + * the specified method. + * + * Returns: a new #SignonAuthSession. + */ +SignonAuthSession * +signon_auth_session_new_for_identity (SignonIdentity *identity, + const gchar *method_name, + GError **err) +{ + g_return_val_if_fail (SIGNON_IS_IDENTITY (identity), NULL); DEBUG ("%s %d", G_STRFUNC, __LINE__); @@ -546,7 +570,7 @@ signon_auth_session_query_available_mechanisms (SignonAuthSession *self, */ void signon_auth_session_process (SignonAuthSession *self, - const GHashTable *session_data, + GHashTable *session_data, const gchar* mechanism, SignonAuthSessionProcessCb cb, gpointer user_data) @@ -576,17 +600,19 @@ signon_auth_session_process (SignonAuthSession *self, * authentication reply is available. * @user_data: user data to be passed to the callback. * - * Performs one step of the authentication process. If the #SignonIdentity that - * this session belongs to contains a username and a password, the daemon will - * pass them to the authentication plugin, otherwise they should be set directly in - * @session_data. + * Performs one step of the authentication process. * @session_data should be used to add additional authentication parameters to the - * session, or to override the parameters otherwise taken from the identity. + * session. * * What specific parameters should be used can be found from authentication plugins' * documentation (look for parameters that are expected in gsignond_plugin_request_initial() * for the first step, and parameters that are expected in gsignond_plugin_request() for * the subsequent steps). See, for example, #GSignondPasswordPlugin and #GSignondDigestPlugin. + * + * If the #SignonIdentity that this session belongs to contains a username and a password, + * the daemon will pass them to the authentication plugin, otherwise they should be set directly in + * @session_data. The daemon also passes a list of identity's allowed realms to the plugin, + * and they cannot be overriden. * * Since: 1.8 */ diff --git a/libgsignon-glib/signon-auth-session.h b/libgsignon-glib/signon-auth-session.h index 21097ea..3cbff61 100644 --- a/libgsignon-glib/signon-auth-session.h +++ b/libgsignon-glib/signon-auth-session.h @@ -5,7 +5,7 @@ * * Copyright (C) 2009-2010 Nokia Corporation. * Copyright (C) 2012 Canonical Ltd. - * Copyright (C) 2012-2013 Intel Corporation. + * Copyright (C) 2012-2014 Intel Corporation. * * Contact: Alberto Mardegan * Contact: Jussi Laako @@ -118,7 +118,6 @@ typedef enum { #define SIGNON_IS_AUTH_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SIGNON_TYPE_AUTH_SESSION)) #define SIGNON_AUTH_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SIGNON_TYPE_AUTH_SESSION, SignonAuthSessionClass)) -typedef struct _SignonAuthSession SignonAuthSession; typedef struct _SignonAuthSessionPrivate SignonAuthSessionPrivate; typedef struct _SignonAuthSessionClass SignonAuthSessionClass; @@ -145,10 +144,15 @@ struct _SignonAuthSessionClass { GType signon_auth_session_get_type (void) G_GNUC_CONST; -SignonAuthSession *signon_auth_session_new(GObject *parent, +SignonAuthSession *signon_auth_session_new(gint id, const gchar *method_name, GError **err); +SignonAuthSession * +signon_auth_session_new_for_identity(SignonIdentity *identity, + const gchar *method_name, + GError **err); + const gchar *signon_auth_session_get_method (SignonAuthSession *self); typedef void (*SignonAuthSessionQueryAvailableMechanismsCb) ( @@ -173,7 +177,7 @@ typedef void (*SignonAuthSessionProcessCb) (SignonAuthSession *self, gpointer user_data); SIGNON_DEPRECATED_FOR(signon_auth_session_process_async) void signon_auth_session_process(SignonAuthSession *self, - const GHashTable *session_data, + GHashTable *session_data, const gchar *mechanism, SignonAuthSessionProcessCb cb, gpointer user_data); diff --git a/libgsignon-glib/signon-enum-types.c b/libgsignon-glib/signon-enum-types.c new file mode 100644 index 0000000..a7cf0fe --- /dev/null +++ b/libgsignon-glib/signon-enum-types.c @@ -0,0 +1,48 @@ + + + +#include "signon-enum-types.h" +#include "signon-identity-info.h" +#include "signon-auth-session.h" +#define g_intern_static_string(s) (s) + +/* enumerations from "signon-auth-session.h" */ +GType +signon_session_data_ui_policy_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { SIGNON_POLICY_DEFAULT, "SIGNON_POLICY_DEFAULT", "default" }, + { SIGNON_POLICY_REQUEST_PASSWORD, "SIGNON_POLICY_REQUEST_PASSWORD", "request-password" }, + { SIGNON_POLICY_NO_USER_INTERACTION, "SIGNON_POLICY_NO_USER_INTERACTION", "no-user-interaction" }, + { SIGNON_POLICY_VALIDATION, "SIGNON_POLICY_VALIDATION", "validation" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static (g_intern_static_string ("SignonSessionDataUiPolicy"), values); + } + return etype; +} + +/* enumerations from "signon-identity-info.h" */ +GType +signon_identity_type_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GFlagsValue values[] = { + { SIGNON_IDENTITY_TYPE_OTHER, "SIGNON_IDENTITY_TYPE_OTHER", "other" }, + { SIGNON_IDENTITY_TYPE_APP, "SIGNON_IDENTITY_TYPE_APP", "app" }, + { SIGNON_IDENTITY_TYPE_WEB, "SIGNON_IDENTITY_TYPE_WEB", "web" }, + { SIGNON_IDENTITY_TYPE_NETWORK, "SIGNON_IDENTITY_TYPE_NETWORK", "network" }, + { 0, NULL, NULL } + }; + etype = g_flags_register_static (g_intern_static_string ("SignonIdentityType"), values); + } + return etype; +} + +#define __SIGNON_ENUM_TYPES_C__ + + + diff --git a/libgsignon-glib/signon-errors-enum.c b/libgsignon-glib/signon-errors-enum.c new file mode 100644 index 0000000..86fc74a --- /dev/null +++ b/libgsignon-glib/signon-errors-enum.c @@ -0,0 +1,61 @@ + + + +#include "signon-enum-types.h" +#include "signon-errors.h" +#include "signon-internals.h" +#define g_intern_static_string(s) (s) + +/* enumerations from "signon-errors.h" */ +GType +signon_error_get_type (void) +{ + static GType etype = 0; + if (etype == 0) { + static const GEnumValue values[] = { + { SIGNON_ERROR_UNKNOWN, SIGNOND_UNKNOWN_ERR_NAME, "unknown" }, + { SIGNON_ERROR_INTERNAL_SERVER, SIGNOND_INTERNAL_SERVER_ERR_NAME, "internal-server" }, + { SIGNON_ERROR_INTERNAL_COMMUNICATION, SIGNOND_INTERNAL_COMMUNICATION_ERR_NAME, "internal-communication" }, + { SIGNON_ERROR_PERMISSION_DENIED, SIGNOND_PERMISSION_DENIED_ERR_NAME, "permission-denied" }, + { SIGNON_ERROR_METHOD_NOT_KNOWN, SIGNOND_METHOD_NOT_KNOWN_ERR_NAME, "method-not-known" }, + { SIGNON_ERROR_SERVICE_NOT_AVAILABLE, SIGNOND_SERVICE_NOT_AVAILABLE_ERR_NAME, "service-not-available" }, + { SIGNON_ERROR_INVALID_QUERY, SIGNOND_INVALID_QUERY_ERR_NAME, "invalid-query" }, + { SIGNON_ERROR_METHOD_NOT_AVAILABLE, SIGNOND_METHOD_NOT_AVAILABLE_ERR_NAME, "method-not-available" }, + { SIGNON_ERROR_IDENTITY_NOT_FOUND, SIGNOND_IDENTITY_NOT_FOUND_ERR_NAME, "identity-not-found" }, + { SIGNON_ERROR_STORE_FAILED, SIGNOND_STORE_FAILED_ERR_NAME, "store-failed" }, + { SIGNON_ERROR_REMOVE_FAILED, SIGNOND_REMOVE_FAILED_ERR_NAME, "remove-failed" }, + { SIGNON_ERROR_SIGNOUT_FAILED, SIGNOND_SIGNOUT_FAILED_ERR_NAME, "signout-failed" }, + { SIGNON_ERROR_IDENTITY_OPERATION_CANCELED, SIGNOND_IDENTITY_OPERATION_CANCELED_ERR_NAME, "identity-operation-canceled" }, + { SIGNON_ERROR_CREDENTIALS_NOT_AVAILABLE, SIGNOND_CREDENTIALS_NOT_AVAILABLE_ERR_NAME, "credentials-not-available" }, + { SIGNON_ERROR_REFERENCE_NOT_FOUND, SIGNOND_REFERENCE_NOT_FOUND_ERR_NAME, "reference-not-found" }, + { SIGNON_ERROR_MECHANISM_NOT_AVAILABLE, SIGNOND_MECHANISM_NOT_AVAILABLE_ERR_NAME, "mechanism-not-available" }, + { SIGNON_ERROR_MISSING_DATA, SIGNOND_MISSING_DATA_ERR_NAME, "missing-data" }, + { SIGNON_ERROR_INVALID_CREDENTIALS, SIGNOND_INVALID_CREDENTIALS_ERR_NAME, "invalid-credentials" }, + { SIGNON_ERROR_NOT_AUTHORIZED, SIGNOND_NOT_AUTHORIZED_ERR_NAME, "not-authorized" }, + { SIGNON_ERROR_WRONG_STATE, SIGNOND_WRONG_STATE_ERR_NAME, "wrong-state" }, + { SIGNON_ERROR_OPERATION_NOT_SUPPORTED, SIGNOND_OPERATION_NOT_SUPPORTED_ERR_NAME, "operation-not-supported" }, + { SIGNON_ERROR_NO_CONNECTION, SIGNOND_NO_CONNECTION_ERR_NAME, "no-connection" }, + { SIGNON_ERROR_NETWORK, SIGNOND_NETWORK_ERR_NAME, "network" }, + { SIGNON_ERROR_SSL, SIGNOND_SSL_ERR_NAME, "ssl" }, + { SIGNON_ERROR_RUNTIME, SIGNOND_RUNTIME_ERR_NAME, "runtime" }, + { SIGNON_ERROR_SESSION_CANCELED, SIGNOND_SESSION_CANCELED_ERR_NAME, "session-canceled" }, + { SIGNON_ERROR_TIMED_OUT, SIGNOND_TIMED_OUT_ERR_NAME, "timed-out" }, + { SIGNON_ERROR_USER_INTERACTION, SIGNOND_USER_INTERACTION_ERR_NAME, "user-interaction" }, + { SIGNON_ERROR_OPERATION_FAILED, SIGNOND_OPERATION_FAILED_ERR_NAME, "operation-failed" }, + { SIGNON_ERROR_ENCRYPTION_FAILED, SIGNOND_ENCRYPTION_FAILED_ERR_NAME, "encryption-failed" }, + { SIGNON_ERROR_TOS_NOT_ACCEPTED, SIGNOND_TOS_NOT_ACCEPTED_ERR_NAME, "tos-not-accepted" }, + { SIGNON_ERROR_FORGOT_PASSWORD, SIGNOND_FORGOT_PASSWORD_ERR_NAME, "forgot-password" }, + { SIGNON_ERROR_METHOD_OR_MECHANISM_NOT_ALLOWED, SIGNOND_METHOD_OR_MECHANISM_NOT_ALLOWED_ERR_NAME, "method-or-mechanism-not-allowed" }, + { SIGNON_ERROR_INCORRECT_DATE, SIGNOND_INCORRECT_DATE_ERR_NAME, "incorrect-date" }, + { SIGNON_ERROR_USER_ERROR, SIGNOND_USER_ERROR_ERR_NAME, "user-error" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static (g_intern_static_string ("SignonError"), values); + } + return etype; +} + +#define __SIGNON_ENUM_TYPES_C__ + + + diff --git a/libgsignon-glib/signon-errors-map.c b/libgsignon-glib/signon-errors-map.c new file mode 100644 index 0000000..7176c1b --- /dev/null +++ b/libgsignon-glib/signon-errors-map.c @@ -0,0 +1,43 @@ +#include + +#include "signon-errors.h" +#include "signon-internals.h" + +static const GDBusErrorEntry signon_error_entries[] = { + { SIGNON_ERROR_UNKNOWN, SIGNOND_UNKNOWN_ERR_NAME }, + { SIGNON_ERROR_INTERNAL_SERVER, SIGNOND_INTERNAL_SERVER_ERR_NAME }, + { SIGNON_ERROR_INTERNAL_COMMUNICATION, SIGNOND_INTERNAL_COMMUNICATION_ERR_NAME }, + { SIGNON_ERROR_PERMISSION_DENIED, SIGNOND_PERMISSION_DENIED_ERR_NAME }, + { SIGNON_ERROR_METHOD_NOT_KNOWN, SIGNOND_METHOD_NOT_KNOWN_ERR_NAME }, + { SIGNON_ERROR_SERVICE_NOT_AVAILABLE, SIGNOND_SERVICE_NOT_AVAILABLE_ERR_NAME }, + { SIGNON_ERROR_INVALID_QUERY, SIGNOND_INVALID_QUERY_ERR_NAME }, + { SIGNON_ERROR_METHOD_NOT_AVAILABLE, SIGNOND_METHOD_NOT_AVAILABLE_ERR_NAME }, + { SIGNON_ERROR_IDENTITY_NOT_FOUND, SIGNOND_IDENTITY_NOT_FOUND_ERR_NAME }, + { SIGNON_ERROR_STORE_FAILED, SIGNOND_STORE_FAILED_ERR_NAME }, + { SIGNON_ERROR_REMOVE_FAILED, SIGNOND_REMOVE_FAILED_ERR_NAME }, + { SIGNON_ERROR_SIGNOUT_FAILED, SIGNOND_SIGNOUT_FAILED_ERR_NAME }, + { SIGNON_ERROR_IDENTITY_OPERATION_CANCELED, SIGNOND_IDENTITY_OPERATION_CANCELED_ERR_NAME }, + { SIGNON_ERROR_CREDENTIALS_NOT_AVAILABLE, SIGNOND_CREDENTIALS_NOT_AVAILABLE_ERR_NAME }, + { SIGNON_ERROR_REFERENCE_NOT_FOUND, SIGNOND_REFERENCE_NOT_FOUND_ERR_NAME }, + { SIGNON_ERROR_MECHANISM_NOT_AVAILABLE, SIGNOND_MECHANISM_NOT_AVAILABLE_ERR_NAME }, + { SIGNON_ERROR_MISSING_DATA, SIGNOND_MISSING_DATA_ERR_NAME }, + { SIGNON_ERROR_INVALID_CREDENTIALS, SIGNOND_INVALID_CREDENTIALS_ERR_NAME }, + { SIGNON_ERROR_NOT_AUTHORIZED, SIGNOND_NOT_AUTHORIZED_ERR_NAME }, + { SIGNON_ERROR_WRONG_STATE, SIGNOND_WRONG_STATE_ERR_NAME }, + { SIGNON_ERROR_OPERATION_NOT_SUPPORTED, SIGNOND_OPERATION_NOT_SUPPORTED_ERR_NAME }, + { SIGNON_ERROR_NO_CONNECTION, SIGNOND_NO_CONNECTION_ERR_NAME }, + { SIGNON_ERROR_NETWORK, SIGNOND_NETWORK_ERR_NAME }, + { SIGNON_ERROR_SSL, SIGNOND_SSL_ERR_NAME }, + { SIGNON_ERROR_RUNTIME, SIGNOND_RUNTIME_ERR_NAME }, + { SIGNON_ERROR_SESSION_CANCELED, SIGNOND_SESSION_CANCELED_ERR_NAME }, + { SIGNON_ERROR_TIMED_OUT, SIGNOND_TIMED_OUT_ERR_NAME }, + { SIGNON_ERROR_USER_INTERACTION, SIGNOND_USER_INTERACTION_ERR_NAME }, + { SIGNON_ERROR_OPERATION_FAILED, SIGNOND_OPERATION_FAILED_ERR_NAME }, + { SIGNON_ERROR_ENCRYPTION_FAILED, SIGNOND_ENCRYPTION_FAILED_ERR_NAME }, + { SIGNON_ERROR_TOS_NOT_ACCEPTED, SIGNOND_TOS_NOT_ACCEPTED_ERR_NAME }, + { SIGNON_ERROR_FORGOT_PASSWORD, SIGNOND_FORGOT_PASSWORD_ERR_NAME }, + { SIGNON_ERROR_METHOD_OR_MECHANISM_NOT_ALLOWED, SIGNOND_METHOD_OR_MECHANISM_NOT_ALLOWED_ERR_NAME }, + { SIGNON_ERROR_INCORRECT_DATE, SIGNOND_INCORRECT_DATE_ERR_NAME }, + { SIGNON_ERROR_USER_ERROR, SIGNOND_USER_ERROR_ERR_NAME }, +}; + diff --git a/libgsignon-glib/signon-identity-info.c b/libgsignon-glib/signon-identity-info.c index 40a8fb6..9f035aa 100644 --- a/libgsignon-glib/signon-identity-info.c +++ b/libgsignon-glib/signon-identity-info.c @@ -5,7 +5,7 @@ * * Copyright (C) 2009-2010 Nokia Corporation. * Copyright (C) 2011-2012 Canonical Ltd. - * Copyright (C) 2012-2013 Intel Corporation. + * Copyright (C) 2012-2014 Intel Corporation. * * Contact: Alberto Mardegan * Contact: Jussi Laako @@ -68,11 +68,13 @@ static void identity_info_set_id (SignonIdentityInfo *info, gint id) info->id = id; } -static void identity_methods_copy (gpointer key, gpointer value, gpointer user_data) +static void identity_methods_copy (gpointer key, + gpointer value, + gpointer user_data) { - signon_identity_info_set_method ((SignonIdentityInfo *)user_data, - (const gchar *)key, - (const gchar* const *)value); + g_hash_table_insert ((GHashTable *) user_data, + g_strdup ((const gchar *) key), + g_strdupv ((gchar **) value)); } /** @@ -80,23 +82,46 @@ static void identity_methods_copy (gpointer key, gpointer value, gpointer user_d * @info: the #SignonIdentityInfo. * @methods: (transfer none): (element-type utf8 GStrv): methods. * - * Set authentication methods that are allowed to be used with this identity. + * Set authentication methods that are allowed to be used with this identity. */ void signon_identity_info_set_methods (SignonIdentityInfo *info, - const GHashTable *methods) + GHashTable *methods) { g_return_if_fail (info != NULL); g_return_if_fail (methods != NULL); DEBUG("%s", G_STRFUNC); - if (info->methods) - g_hash_table_remove_all (info->methods); - else - info->methods = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, (GDestroyNotify)g_strfreev); + GHashTable *new_methods = + g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + (GDestroyNotify) g_strfreev); + g_hash_table_foreach (methods, identity_methods_copy, new_methods); + g_hash_table_unref (info->methods); + info->methods = new_methods; +} + +/** + * signon_identity_info_own_methods: + * @info: the #SignonIdentityInfo. + * @methods: (transfer none): (element-type utf8 GStrv): methods. + * + * Set authentication methods that are allowed to be used with this identity. + * + * This function will just increment reference count of hash table, so + * it should be constructed with #g_hash_table_new_full. + */ +void signon_identity_info_own_methods (SignonIdentityInfo *info, + GHashTable *methods) +{ + g_return_if_fail (info != NULL); + g_return_if_fail (methods != NULL); + + DEBUG("%s", G_STRFUNC); - g_hash_table_foreach ((GHashTable *)methods, identity_methods_copy, info); + g_hash_table_ref (methods); + info->methods = methods; } SignonIdentityInfo * @@ -123,16 +148,15 @@ signon_identity_info_new_from_variant (GVariant *variant) "s", &info->username); - if (g_variant_lookup (variant, - SIGNOND_IDENTITY_INFO_SECRET, - "s", - &info->secret)) - { - g_variant_lookup (variant, - SIGNOND_IDENTITY_INFO_STORESECRET, - "b", - &info->store_secret); - } + g_variant_lookup (variant, + SIGNOND_IDENTITY_INFO_SECRET, + "s", + &info->secret); + + g_variant_lookup (variant, + SIGNOND_IDENTITY_INFO_STORESECRET, + "b", + &info->store_secret); g_variant_lookup (variant, SIGNOND_IDENTITY_INFO_CAPTION, @@ -205,38 +229,46 @@ signon_identity_info_to_variant (const SignonIdentityInfo *self) SIGNOND_IDENTITY_INFO_ID, g_variant_new_uint32 (self->id)); - g_variant_builder_add (&builder, "{sv}", - SIGNOND_IDENTITY_INFO_USERNAME, - signon_variant_new_string (self->username)); + if (self->username != NULL) { + g_variant_builder_add (&builder, "{sv}", + SIGNOND_IDENTITY_INFO_USERNAME, + signon_variant_new_string (self->username)); + } - g_variant_builder_add (&builder, "{sv}", - SIGNOND_IDENTITY_INFO_SECRET, - signon_variant_new_string (self->secret)); + if (self->secret != NULL) { + g_variant_builder_add (&builder, "{sv}", + SIGNOND_IDENTITY_INFO_SECRET, + signon_variant_new_string (self->secret)); + } - g_variant_builder_add (&builder, "{sv}", - SIGNOND_IDENTITY_INFO_CAPTION, - signon_variant_new_string (self->caption)); + if (self->caption != NULL) { + g_variant_builder_add (&builder, "{sv}", + SIGNOND_IDENTITY_INFO_CAPTION, + signon_variant_new_string (self->caption)); + } g_variant_builder_add (&builder, "{sv}", SIGNOND_IDENTITY_INFO_STORESECRET, g_variant_new_boolean (self->store_secret)); - g_variant_builder_init (&method_builder, - (const GVariantType *)"a{sas}"); - g_hash_table_iter_init (&iter, self->methods); - while (g_hash_table_iter_next (&iter, - (gpointer)&method, - (gpointer)&mechanisms)) - { - g_variant_builder_add (&method_builder, "{s^as}", - method, - mechanisms); - } - method_map = g_variant_builder_end (&method_builder); + if (g_hash_table_size(self->methods) > 0) { + g_variant_builder_init (&method_builder, + (const GVariantType *)"a{sas}"); + g_hash_table_iter_init (&iter, self->methods); + while (g_hash_table_iter_next (&iter, + (gpointer)&method, + (gpointer)&mechanisms)) + { + g_variant_builder_add (&method_builder, "{s^as}", + method, + mechanisms); + } + method_map = g_variant_builder_end (&method_builder); - g_variant_builder_add (&builder, "{sv}", - SIGNOND_IDENTITY_INFO_AUTHMETHODS, - method_map); + g_variant_builder_add (&builder, "{sv}", + SIGNOND_IDENTITY_INFO_AUTHMETHODS, + method_map); + } if (self->realms != NULL) { @@ -284,8 +316,10 @@ signon_identity_info_to_variant (const SignonIdentityInfo *self) SignonIdentityInfo *signon_identity_info_new () { SignonIdentityInfo *info = g_slice_new0 (SignonIdentityInfo); - info->methods = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, (GDestroyNotify)g_strfreev); + info->methods = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + (GDestroyNotify) g_strfreev); info->store_secret = FALSE; return info; @@ -305,7 +339,7 @@ void signon_identity_info_free (SignonIdentityInfo *info) g_free (info->secret); g_free (info->caption); - g_hash_table_destroy (info->methods); + g_hash_table_unref (info->methods); g_strfreev (info->realms); signon_security_context_free (info->owner); @@ -422,7 +456,7 @@ const gchar *signon_identity_info_get_caption (const SignonIdentityInfo *info) * Returns: (transfer none): (element-type utf8 GStrv): the table of allowed * methods and mechanisms. */ -const GHashTable *signon_identity_info_get_methods (const SignonIdentityInfo *info) +GHashTable *signon_identity_info_get_methods (const SignonIdentityInfo *info) { g_return_val_if_fail (info != NULL, NULL); return info->methods; @@ -432,7 +466,7 @@ const GHashTable *signon_identity_info_get_methods (const SignonIdentityInfo *in * signon_identity_info_get_realms: * @info: the #SignonIdentityInfo. * - * Get an array of the realms of @info. + * Get an array of the allowed realms of @info. * * Returns: (transfer none): a %NULL terminated array of realms. */ @@ -464,7 +498,7 @@ const SignonSecurityContext *signon_identity_info_get_owner (const SignonIdentit * * Returns: (transfer none): a list of ACL security contexts. */ -const SignonSecurityContextList *signon_identity_info_get_access_control_list (const SignonIdentityInfo *info) +SignonSecurityContextList *signon_identity_info_get_access_control_list (const SignonIdentityInfo *info) { g_return_val_if_fail (info != NULL, NULL); return info->access_control_list; @@ -484,6 +518,14 @@ SignonIdentityType signon_identity_info_get_identity_type (const SignonIdentityI return (SignonIdentityType)info->type; } + +static void _replace_string (gchar **dst, const gchar *src) +{ + gchar *new_str = g_strdup (src); + g_free (*dst); + *dst = new_str; +} + /** * signon_identity_info_set_username: * @info: the #SignonIdentityInfo. @@ -492,13 +534,12 @@ SignonIdentityType signon_identity_info_get_identity_type (const SignonIdentityI * Sets the username for the identity. * */ -void signon_identity_info_set_username (SignonIdentityInfo *info, const gchar *username) +void signon_identity_info_set_username (SignonIdentityInfo *info, + const gchar *username) { g_return_if_fail (info != NULL); - if (info->username) g_free (info->username); - - info->username = g_strdup (username); + _replace_string (&info->username, username); } /** @@ -511,14 +552,13 @@ void signon_identity_info_set_username (SignonIdentityInfo *info, const gchar *u * should remember it. * */ -void signon_identity_info_set_secret (SignonIdentityInfo *info, const gchar *secret, +void signon_identity_info_set_secret (SignonIdentityInfo *info, + const gchar *secret, gboolean store_secret) { g_return_if_fail (info != NULL); - if (info->secret) g_free (info->secret); - - info->secret = g_strdup (secret); + _replace_string (&info->secret, secret); info->store_secret = store_secret; } @@ -530,13 +570,12 @@ void signon_identity_info_set_secret (SignonIdentityInfo *info, const gchar *sec * Sets the caption (display name) for the identity. * */ -void signon_identity_info_set_caption (SignonIdentityInfo *info, const gchar *caption) +void signon_identity_info_set_caption (SignonIdentityInfo *info, + const gchar *caption) { g_return_if_fail (info != NULL); - if (info->caption) g_free (info->caption); - - info->caption = g_strdup (caption); + _replace_string (&info->caption, caption); } /** @@ -587,9 +626,11 @@ void signon_identity_info_set_realms (SignonIdentityInfo *info, { g_return_if_fail (info != NULL); + gchar **new_realms = g_strdupv ((gchar **) realms); + if (info->realms) g_strfreev (info->realms); - info->realms = g_strdupv ((gchar **)realms); + info->realms = new_realms; } /** @@ -604,9 +645,11 @@ void signon_identity_info_set_owner (SignonIdentityInfo *info, { g_return_if_fail (info != NULL); + SignonSecurityContext *new_owner = signon_security_context_copy (owner); + if (info->owner) signon_security_context_free (info->owner); - info->owner = signon_security_context_copy (owner); + info->owner = new_owner; } /** @@ -640,15 +683,17 @@ void signon_identity_info_set_owner_from_values ( * Set an access control list associated with an identity. */ void signon_identity_info_set_access_control_list (SignonIdentityInfo *info, - const SignonSecurityContextList *access_control_list) + SignonSecurityContextList *access_control_list) { g_return_if_fail (info != NULL); + SignonSecurityContextList *new_acl = + signon_security_context_list_copy (access_control_list); + if (info->access_control_list) signon_security_context_list_free (info->access_control_list); - info->access_control_list = - signon_security_context_list_copy (access_control_list); + info->access_control_list = new_acl; } /** @@ -680,5 +725,5 @@ void signon_identity_info_set_identity_type (SignonIdentityInfo *info, SignonIdentityType type) { g_return_if_fail (info != NULL); - info->type = (gint)type; + info->type = (gint) type; } diff --git a/libgsignon-glib/signon-identity-info.h b/libgsignon-glib/signon-identity-info.h index a71331f..4edb491 100644 --- a/libgsignon-glib/signon-identity-info.h +++ b/libgsignon-glib/signon-identity-info.h @@ -5,7 +5,7 @@ * * Copyright (C) 2009-2010 Nokia Corporation. * Copyright (C) 2011 Canonical Ltd. - * Copyright (C) 2012-2013 Intel Corporation. + * Copyright (C) 2012-2014 Intel Corporation. * * Contact: Alberto Mardegan * Contact: Jussi Laako @@ -69,25 +69,27 @@ const gchar *signon_identity_info_get_username (const SignonIdentityInfo *info); gboolean signon_identity_info_get_storing_secret ( const SignonIdentityInfo *info); const gchar *signon_identity_info_get_caption (const SignonIdentityInfo *info); -const GHashTable *signon_identity_info_get_methods ( - const SignonIdentityInfo *info); +GHashTable *signon_identity_info_get_methods (const SignonIdentityInfo *info); const gchar* const *signon_identity_info_get_realms ( const SignonIdentityInfo *info); const SignonSecurityContext *signon_identity_info_get_owner ( const SignonIdentityInfo *info); -const SignonSecurityContextList *signon_identity_info_get_access_control_list ( +SignonSecurityContextList *signon_identity_info_get_access_control_list ( const SignonIdentityInfo *info); SignonIdentityType signon_identity_info_get_identity_type ( const SignonIdentityInfo *info); -void signon_identity_info_set_username (SignonIdentityInfo *info, const gchar *username); +void signon_identity_info_set_username (SignonIdentityInfo *info, + const gchar *username); void signon_identity_info_set_secret (SignonIdentityInfo *info, const gchar *secret, gboolean store_secret); void signon_identity_info_set_caption (SignonIdentityInfo *info, const gchar *caption); void signon_identity_info_set_methods (SignonIdentityInfo *info, - const GHashTable *methods); + GHashTable *methods); +void signon_identity_info_own_methods (SignonIdentityInfo *info, + GHashTable *methods); void signon_identity_info_set_method (SignonIdentityInfo *info, const gchar *method, const gchar* const *mechanisms); @@ -101,7 +103,7 @@ void signon_identity_info_set_owner_from_values (SignonIdentityInfo *info, const gchar *system_context, const gchar *application_context); void signon_identity_info_set_access_control_list (SignonIdentityInfo *info, - const SignonSecurityContextList *access_control_list); + SignonSecurityContextList *access_control_list); void signon_identity_info_access_control_list_append (SignonIdentityInfo *info, SignonSecurityContext *security_context); void signon_identity_info_set_identity_type (SignonIdentityInfo *info, diff --git a/libgsignon-glib/signon-identity.c b/libgsignon-glib/signon-identity.c index 18f06af..730f771 100644 --- a/libgsignon-glib/signon-identity.c +++ b/libgsignon-glib/signon-identity.c @@ -5,7 +5,7 @@ * * Copyright (C) 2009-2010 Nokia Corporation. * Copyright (C) 2012 Canonical Ltd. - * Copyright (C) 2012-2013 Intel Corporation. + * Copyright (C) 2012-2014 Intel Corporation. * * Contact: Alberto Mardegan * Contact: Jussi Laako @@ -42,9 +42,10 @@ * * Operations on an identity * - * - a new identity can be created with signon_identity_new(). This operation - * does not store the identity to the database, the identity is not visible - * to other applications, and accordingly it is not subject to access control. + * - a new identity can be created with signon_identity_new() or + * signon_identity_new_with_context(). This operation does not store the + * identity to the database, the identity is not visible to other applications, + * and accordingly it is not subject to access control. * * - an authentication session can be started from an identity using * signon_identity_create_session() or signon_auth_session_new(). If the identity @@ -55,9 +56,10 @@ * signon_auth_service_query_identities(). Only the identites owned by the * requesting application are returned. * - * - identities stored in a database can be retrieved using signon_identity_new_from_db(), - * subject to access control (an application performing that operation has to be - * either the identity's owner, or it has to be on the ACL list). + * - identities stored in a database can be retrieved using signon_identity_new_from_db() + * or signon_identity_new_with_context_from_db(), subject to access control (an + * application performing that operation has to be either the identity's owner, + * or it has to be on the ACL list). * * - newly created identities can be stored to the database, and identities already * in the database can be updated using signon_identity_store_credentials_with_info() @@ -94,7 +96,7 @@ * owner. Owners are allowed to perform all of the operations on the identity * specified above. By default an identity's owner is determined by gSSO daemon * using system services for the system context, and a string supplied in - * signon_identity_new() for the application context. + * signon_identity_new_with_context() for the application context. * * - ACL is a list of #SignonSecurityContext objects, that specifies applications * that can access the identity to perform authentication sessions. They're not @@ -691,6 +693,29 @@ identity_check_remote_registration (SignonIdentity *self) /** * signon_identity_new_from_db: * @id: identity ID. + * + * Construct an identity object associated with an existing identity + * record. + * This is essentially equivalent to calling + * signon_identity_new_with_context_from_db() and passing %NULL as the + * application context. + * + * Applications can determine the @id either by enumerating the identities with + * signon_auth_service_query_identities() (if they're the owner of the identity) + * or via other means (such as the system's accounts service, or an application + * configuration). + * + * Returns: an instance of a #SignonIdentity. + */ +SignonIdentity * +signon_identity_new_from_db (guint32 id) +{ + return signon_identity_new_with_context_from_db (id, NULL); +} + +/** + * signon_identity_new_with_context_from_db: + * @id: identity ID. * @application_context: application security context, can be %NULL. * * Construct an identity object associated with an existing identity @@ -707,7 +732,7 @@ identity_check_remote_registration (SignonIdentity *self) * Returns: an instance of a #SignonIdentity. */ SignonIdentity* -signon_identity_new_from_db (guint32 id, const gchar *application_context) +signon_identity_new_with_context_from_db (guint32 id, const gchar *application_context) { SignonIdentity *identity; DEBUG ("%s %d: %d\n", G_STRFUNC, __LINE__, id); @@ -731,6 +756,21 @@ signon_identity_new_from_db (guint32 id, const gchar *application_context) /** * signon_identity_new: + * + * Construct a new, empty, identity object. + * This is essentially equivalent to calling signon_identity_new_with_context() + * and passing %NULL as the application context. + * + * Returns: an instance of an #SignonIdentity. + */ +SignonIdentity * +signon_identity_new () +{ + return signon_identity_new_with_context (NULL); +} + +/** + * signon_identity_new_with_context: * @application_context: application security context, can be %NULL. * * Construct a new, empty, identity object. See #SignonSecurityContext for a @@ -741,7 +781,7 @@ signon_identity_new_from_db (guint32 id, const gchar *application_context) * Returns: an instance of an #SignonIdentity. */ SignonIdentity* -signon_identity_new (const gchar *application_context) +signon_identity_new_with_context (const gchar *application_context) { DEBUG ("%s %d", G_STRFUNC, __LINE__); SignonIdentity *identity = g_object_new ( @@ -811,9 +851,10 @@ signon_identity_create_session(SignonIdentity *self, list = list->next; } - SignonAuthSession *session = signon_auth_session_new (G_OBJECT(self), - method, - error); + SignonAuthSession *session = + signon_auth_session_new_for_identity (self, + method, + error); if (session) { DEBUG ("%s %d - success", G_STRFUNC, __LINE__); @@ -858,9 +899,10 @@ signon_identity_store_credentials_with_info(SignonIdentity *self, g_return_if_fail (info != NULL); SignonIdentityPrivate *priv = self->priv; + SignonIdentityInfo *new_info = signon_identity_info_copy (info); if (priv->identity_info) signon_identity_info_free (priv->identity_info); - priv->identity_info = signon_identity_info_copy (info); + priv->identity_info = new_info; cb_data = g_slice_new0 (IdentityStoreCredentialsCbData); cb_data->self = self; @@ -868,7 +910,8 @@ signon_identity_store_credentials_with_info(SignonIdentity *self, cb_data->user_data = user_data; operation_data = g_slice_new0 (IdentityStoreCredentialsData); - operation_data->info_variant = signon_identity_info_to_variant (info); + operation_data->info_variant = + signon_identity_info_to_variant (priv->identity_info); operation_data->cb_data = cb_data; identity_check_remote_registration (self); @@ -886,7 +929,7 @@ signon_identity_store_credentials_with_info(SignonIdentity *self, * @store_secret: whether gSSO should save the password in secret storage. * @methods: (transfer none) (element-type utf8 GStrv): allowed methods. * @caption: (allow-none): caption. - * @realms: (allow-none): realms. + * @realms: (allow-none): allowed realms. * @owner: (allow-none): owner. * @access_control_list: (allow-none): access control list. * @type: the type of the identity. @@ -900,11 +943,11 @@ void signon_identity_store_credentials_with_args(SignonIdentity *self, const gchar *username, const gchar *secret, const gboolean store_secret, - const GHashTable *methods, + GHashTable *methods, const gchar *caption, const gchar* const *realms, const SignonSecurityContext *owner, - const SignonSecurityContextList *access_control_list, + SignonSecurityContextList *access_control_list, SignonIdentityType type, SignonIdentityStoreCredentialsCb cb, gpointer user_data) diff --git a/libgsignon-glib/signon-identity.h b/libgsignon-glib/signon-identity.h index 98d0977..2ac8da0 100644 --- a/libgsignon-glib/signon-identity.h +++ b/libgsignon-glib/signon-identity.h @@ -4,7 +4,7 @@ * This file is part of libgsignon-glib * * Copyright (C) 2009-2010 Nokia Corporation. - * Copyright (C) 2012-2013 Intel Corporation. + * Copyright (C) 2012-2014 Intel Corporation. * * Contact: Alberto Mardegan * Contact: Jussi Laako @@ -42,7 +42,6 @@ G_BEGIN_DECLS typedef struct _SignonIdentityClass SignonIdentityClass; typedef struct _SignonIdentityPrivate SignonIdentityPrivate; -typedef struct _SignonIdentity SignonIdentity; /** * SignonIdentityClass: @@ -105,9 +104,12 @@ typedef SignonIdentityVoidCb SignonIdentityReferenceRemovedCb; GType signon_identity_get_type (void) G_GNUC_CONST; -SignonIdentity *signon_identity_new_from_db (guint32 id, - const gchar *application_context); -SignonIdentity *signon_identity_new (const gchar *application_context); +SignonIdentity *signon_identity_new_from_db (guint32 id); +SignonIdentity *signon_identity_new (); + +SignonIdentity *signon_identity_new_with_context_from_db (guint32 id, + const gchar *application_context); +SignonIdentity *signon_identity_new_with_context (const gchar *application_context); const GError *signon_identity_get_last_error (SignonIdentity *identity); @@ -139,11 +141,11 @@ void signon_identity_store_credentials_with_args(SignonIdentity *self, const gchar *username, const gchar *secret, const gboolean store_secret, - const GHashTable *methods, + GHashTable *methods, const gchar *caption, const gchar* const *realms, const SignonSecurityContext *owner, - const SignonSecurityContextList *access_control_list, + SignonSecurityContextList *access_control_list, SignonIdentityType type, SignonIdentityStoreCredentialsCb cb, gpointer user_data); @@ -170,14 +172,14 @@ void signon_identity_verify_secret(SignonIdentity *self, /** * SignonIdentityInfoCb: * @self: the #SignonIdentity. - * @info: the #SignonIdentityInfo for @self. + * @info: (transfer none): the #SignonIdentityInfo for @self. * @error: a #GError if an error occurred, or %NULL otherwise. * @user_data: the user data that was passed when installing this callback. * * Callback to be passed to signon_identity_query_info(). */ typedef void (*SignonIdentityInfoCb) (SignonIdentity *self, - const SignonIdentityInfo *info, + SignonIdentityInfo *info, const GError *error, gpointer user_data); diff --git a/libgsignon-glib/signon-marshal.c b/libgsignon-glib/signon-marshal.c new file mode 100644 index 0000000..d880e61 --- /dev/null +++ b/libgsignon-glib/signon-marshal.c @@ -0,0 +1,88 @@ + +#include + + +#ifdef G_ENABLE_DEBUG +#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) +#define g_marshal_value_peek_char(v) g_value_get_schar (v) +#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) +#define g_marshal_value_peek_int(v) g_value_get_int (v) +#define g_marshal_value_peek_uint(v) g_value_get_uint (v) +#define g_marshal_value_peek_long(v) g_value_get_long (v) +#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) +#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) +#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) +#define g_marshal_value_peek_enum(v) g_value_get_enum (v) +#define g_marshal_value_peek_flags(v) g_value_get_flags (v) +#define g_marshal_value_peek_float(v) g_value_get_float (v) +#define g_marshal_value_peek_double(v) g_value_get_double (v) +#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) +#define g_marshal_value_peek_param(v) g_value_get_param (v) +#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) +#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) +#define g_marshal_value_peek_object(v) g_value_get_object (v) +#define g_marshal_value_peek_variant(v) g_value_get_variant (v) +#else /* !G_ENABLE_DEBUG */ +/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. + * Do not access GValues directly in your code. Instead, use the + * g_value_get_*() functions + */ +#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int +#define g_marshal_value_peek_char(v) (v)->data[0].v_int +#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint +#define g_marshal_value_peek_int(v) (v)->data[0].v_int +#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint +#define g_marshal_value_peek_long(v) (v)->data[0].v_long +#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 +#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 +#define g_marshal_value_peek_enum(v) (v)->data[0].v_long +#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong +#define g_marshal_value_peek_float(v) (v)->data[0].v_float +#define g_marshal_value_peek_double(v) (v)->data[0].v_double +#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer +#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer +#endif /* !G_ENABLE_DEBUG */ + + +/* VOID:INT,STRING (signon-marshal.list:1) */ +void +_signon_marshal_VOID__INT_STRING (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__INT_STRING) (gpointer data1, + gint arg_1, + gpointer arg_2, + gpointer data2); + register GMarshalFunc_VOID__INT_STRING callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__INT_STRING) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_int (param_values + 1), + g_marshal_value_peek_string (param_values + 2), + data2); +} + diff --git a/libgsignon-glib/signon-marshal.h b/libgsignon-glib/signon-marshal.h new file mode 100644 index 0000000..5799829 --- /dev/null +++ b/libgsignon-glib/signon-marshal.h @@ -0,0 +1,20 @@ + +#ifndef ___signon_marshal_MARSHAL_H__ +#define ___signon_marshal_MARSHAL_H__ + +#include + +G_BEGIN_DECLS + +/* VOID:INT,STRING (signon-marshal.list:1) */ +extern void _signon_marshal_VOID__INT_STRING (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +G_END_DECLS + +#endif /* ___signon_marshal_MARSHAL_H__ */ + diff --git a/libgsignon-glib/signon-types.h b/libgsignon-glib/signon-types.h index cc2de90..c50a21c 100644 --- a/libgsignon-glib/signon-types.h +++ b/libgsignon-glib/signon-types.h @@ -29,6 +29,9 @@ G_BEGIN_DECLS +typedef struct _SignonAuthSession SignonAuthSession; +typedef struct _SignonIdentity SignonIdentity; + #ifdef SIGNON_DISABLE_DEPRECATION_WARNINGS #define SIGNON_DEPRECATED #define SIGNON_DEPRECATED_FOR(x) diff --git a/libgsignon-glib/signon-utils.c b/libgsignon-glib/signon-utils.c index fff3a4d..208243b 100644 --- a/libgsignon-glib/signon-utils.c +++ b/libgsignon-glib/signon-utils.c @@ -5,6 +5,7 @@ * * Copyright (C) 2009-2010 Nokia Corporation. * Copyright (C) 2012 Canonical Ltd. + * Copyright (C) 2014 Intel Corporation. * * Contact: Alberto Mardegan * @@ -88,7 +89,7 @@ GHashTable *signon_hash_table_from_variant (GVariant *variant) return hash_table; } -GVariant *signon_hash_table_to_variant (const GHashTable *hash_table) +GVariant *signon_hash_table_to_variant (GHashTable *hash_table) { GVariantBuilder builder; GHashTableIter iter; @@ -99,7 +100,7 @@ GVariant *signon_hash_table_to_variant (const GHashTable *hash_table) g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT); - g_hash_table_iter_init (&iter, (GHashTable *)hash_table); + g_hash_table_iter_init (&iter, hash_table); while (g_hash_table_iter_next (&iter, (gpointer)&key, (gpointer)&value)) { GVariant *val; diff --git a/libgsignon-glib/signon-utils.h b/libgsignon-glib/signon-utils.h index 9a81e8b..3ac03b0 100644 --- a/libgsignon-glib/signon-utils.h +++ b/libgsignon-glib/signon-utils.h @@ -5,6 +5,7 @@ * * Copyright (C) 2009-2010 Nokia Corporation. * Copyright (C) 2012 Canonical Ltd. + * Copyright (C) 2014 Intel Corporation. * * Contact: Alberto Mardegan * @@ -40,6 +41,6 @@ void signon_gvalue_free (gpointer val); G_GNUC_INTERNAL GHashTable *signon_hash_table_from_variant (GVariant *variant); G_GNUC_INTERNAL -GVariant *signon_hash_table_to_variant (const GHashTable *hash_table); +GVariant *signon_hash_table_to_variant (GHashTable *hash_table); #endif //_SIGNON_UTILS_H_ diff --git a/libgsignon-glib/sso-auth-service-gen.c b/libgsignon-glib/sso-auth-service-gen.c new file mode 100644 index 0000000..55bdf72 --- /dev/null +++ b/libgsignon-glib/sso-auth-service-gen.c @@ -0,0 +1,2723 @@ +/* + * Generated by gdbus-codegen 2.32.4. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "sso-auth-service-gen.h" + +#include +#ifdef G_OS_UNIX +# include +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface com.google.code.AccountsSSO.gSingleSignOn.AuthService + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:SsoAuthService + * @title: SsoAuthService + * @short_description: Generated C code for the com.google.code.AccountsSSO.gSingleSignOn.AuthService D-Bus interface + * + * This section contains code for working with the com.google.code.AccountsSSO.gSingleSignOn.AuthService D-Bus interface in C. + */ + +/* ---- Introspection data for com.google.code.AccountsSSO.gSingleSignOn.AuthService ---- */ + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_register_new_identity_IN_ARG_applicationContext = +{ + { + -1, + "applicationContext", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_register_new_identity_IN_ARG_pointers[] = +{ + &_sso_auth_service_method_info_register_new_identity_IN_ARG_applicationContext, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_register_new_identity_OUT_ARG_objectPath = +{ + { + -1, + "objectPath", + "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_register_new_identity_OUT_ARG_pointers[] = +{ + &_sso_auth_service_method_info_register_new_identity_OUT_ARG_objectPath, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_service_method_info_register_new_identity = +{ + { + -1, + "registerNewIdentity", + (GDBusArgInfo **) &_sso_auth_service_method_info_register_new_identity_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_auth_service_method_info_register_new_identity_OUT_ARG_pointers, + NULL + }, + "handle-register-new-identity", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_get_identity_IN_ARG_id = +{ + { + -1, + "id", + "u", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_get_identity_IN_ARG_applicationContext = +{ + { + -1, + "applicationContext", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_get_identity_IN_ARG_pointers[] = +{ + &_sso_auth_service_method_info_get_identity_IN_ARG_id, + &_sso_auth_service_method_info_get_identity_IN_ARG_applicationContext, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_get_identity_OUT_ARG_objectPath = +{ + { + -1, + "objectPath", + "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_get_identity_OUT_ARG_identityData = +{ + { + -1, + "identityData", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_get_identity_OUT_ARG_pointers[] = +{ + &_sso_auth_service_method_info_get_identity_OUT_ARG_objectPath, + &_sso_auth_service_method_info_get_identity_OUT_ARG_identityData, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_service_method_info_get_identity = +{ + { + -1, + "getIdentity", + (GDBusArgInfo **) &_sso_auth_service_method_info_get_identity_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_auth_service_method_info_get_identity_OUT_ARG_pointers, + NULL + }, + "handle-get-identity", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_query_methods_OUT_ARG_authMethods = +{ + { + -1, + "authMethods", + "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_query_methods_OUT_ARG_pointers[] = +{ + &_sso_auth_service_method_info_query_methods_OUT_ARG_authMethods, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_service_method_info_query_methods = +{ + { + -1, + "queryMethods", + NULL, + (GDBusArgInfo **) &_sso_auth_service_method_info_query_methods_OUT_ARG_pointers, + NULL + }, + "handle-query-methods", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_query_mechanisms_IN_ARG_method = +{ + { + -1, + "method", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_query_mechanisms_IN_ARG_pointers[] = +{ + &_sso_auth_service_method_info_query_mechanisms_IN_ARG_method, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_query_mechanisms_OUT_ARG_mechanisms = +{ + { + -1, + "mechanisms", + "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_query_mechanisms_OUT_ARG_pointers[] = +{ + &_sso_auth_service_method_info_query_mechanisms_OUT_ARG_mechanisms, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_service_method_info_query_mechanisms = +{ + { + -1, + "queryMechanisms", + (GDBusArgInfo **) &_sso_auth_service_method_info_query_mechanisms_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_auth_service_method_info_query_mechanisms_OUT_ARG_pointers, + NULL + }, + "handle-query-mechanisms", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_query_identities_IN_ARG_filter = +{ + { + -1, + "filter", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_query_identities_IN_ARG_applicationContext = +{ + { + -1, + "applicationContext", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_query_identities_IN_ARG_pointers[] = +{ + &_sso_auth_service_method_info_query_identities_IN_ARG_filter, + &_sso_auth_service_method_info_query_identities_IN_ARG_applicationContext, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_query_identities_OUT_ARG_identities = +{ + { + -1, + "identities", + "aa{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_query_identities_OUT_ARG_pointers[] = +{ + &_sso_auth_service_method_info_query_identities_OUT_ARG_identities, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_service_method_info_query_identities = +{ + { + -1, + "queryIdentities", + (GDBusArgInfo **) &_sso_auth_service_method_info_query_identities_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_auth_service_method_info_query_identities_OUT_ARG_pointers, + NULL + }, + "handle-query-identities", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_clear_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "b", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_clear_OUT_ARG_pointers[] = +{ + &_sso_auth_service_method_info_clear_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_service_method_info_clear = +{ + { + -1, + "clear", + NULL, + (GDBusArgInfo **) &_sso_auth_service_method_info_clear_OUT_ARG_pointers, + NULL + }, + "handle-clear", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_backup_starts_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "y", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_backup_starts_OUT_ARG_pointers[] = +{ + &_sso_auth_service_method_info_backup_starts_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_service_method_info_backup_starts = +{ + { + -1, + "backupStarts", + NULL, + (GDBusArgInfo **) &_sso_auth_service_method_info_backup_starts_OUT_ARG_pointers, + NULL + }, + "handle-backup-starts", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_backup_finished_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "y", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_backup_finished_OUT_ARG_pointers[] = +{ + &_sso_auth_service_method_info_backup_finished_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_service_method_info_backup_finished = +{ + { + -1, + "backupFinished", + NULL, + (GDBusArgInfo **) &_sso_auth_service_method_info_backup_finished_OUT_ARG_pointers, + NULL + }, + "handle-backup-finished", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_restore_starts_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "y", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_restore_starts_OUT_ARG_pointers[] = +{ + &_sso_auth_service_method_info_restore_starts_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_service_method_info_restore_starts = +{ + { + -1, + "restoreStarts", + NULL, + (GDBusArgInfo **) &_sso_auth_service_method_info_restore_starts_OUT_ARG_pointers, + NULL + }, + "handle-restore-starts", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_service_method_info_restore_finished_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "y", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_service_method_info_restore_finished_OUT_ARG_pointers[] = +{ + &_sso_auth_service_method_info_restore_finished_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_service_method_info_restore_finished = +{ + { + -1, + "restoreFinished", + NULL, + (GDBusArgInfo **) &_sso_auth_service_method_info_restore_finished_OUT_ARG_pointers, + NULL + }, + "handle-restore-finished", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _sso_auth_service_method_info_pointers[] = +{ + &_sso_auth_service_method_info_register_new_identity, + &_sso_auth_service_method_info_get_identity, + &_sso_auth_service_method_info_query_methods, + &_sso_auth_service_method_info_query_mechanisms, + &_sso_auth_service_method_info_query_identities, + &_sso_auth_service_method_info_clear, + &_sso_auth_service_method_info_backup_starts, + &_sso_auth_service_method_info_backup_finished, + &_sso_auth_service_method_info_restore_starts, + &_sso_auth_service_method_info_restore_finished, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _sso_auth_service_interface_info = +{ + { + -1, + "com.google.code.AccountsSSO.gSingleSignOn.AuthService", + (GDBusMethodInfo **) &_sso_auth_service_method_info_pointers, + NULL, + NULL, + NULL + }, + "sso-auth-service", +}; + + +/** + * sso_auth_service_interface_info: + * + * Gets a machine-readable description of the com.google.code.AccountsSSO.gSingleSignOn.AuthService D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +sso_auth_service_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_sso_auth_service_interface_info; +} + +/** + * sso_auth_service_override_properties: + * @klass: The class structure for a #GObject-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #SsoAuthService interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +sso_auth_service_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * SsoAuthService: + * + * Abstract interface type for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.AuthService. + */ + +/** + * SsoAuthServiceIface: + * @parent_iface: The parent interface. + * @handle_backup_finished: Handler for the #SsoAuthService::handle-backup-finished signal. + * @handle_backup_starts: Handler for the #SsoAuthService::handle-backup-starts signal. + * @handle_clear: Handler for the #SsoAuthService::handle-clear signal. + * @handle_get_identity: Handler for the #SsoAuthService::handle-get-identity signal. + * @handle_query_identities: Handler for the #SsoAuthService::handle-query-identities signal. + * @handle_query_mechanisms: Handler for the #SsoAuthService::handle-query-mechanisms signal. + * @handle_query_methods: Handler for the #SsoAuthService::handle-query-methods signal. + * @handle_register_new_identity: Handler for the #SsoAuthService::handle-register-new-identity signal. + * @handle_restore_finished: Handler for the #SsoAuthService::handle-restore-finished signal. + * @handle_restore_starts: Handler for the #SsoAuthService::handle-restore-starts signal. + * + * Virtual table for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.AuthService. + */ + +static void +sso_auth_service_default_init (SsoAuthServiceIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * SsoAuthService::handle-register-new-identity: + * @object: A #SsoAuthService. + * @invocation: A #GDBusMethodInvocation. + * @arg_applicationContext: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the registerNewIdentity() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_service_complete_register_new_identity() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-register-new-identity", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthServiceIface, handle_register_new_identity), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * SsoAuthService::handle-get-identity: + * @object: A #SsoAuthService. + * @invocation: A #GDBusMethodInvocation. + * @arg_id: Argument passed by remote caller. + * @arg_applicationContext: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the getIdentity() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_service_complete_get_identity() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-identity", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthServiceIface, handle_get_identity), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_UINT, G_TYPE_STRING); + + /** + * SsoAuthService::handle-query-methods: + * @object: A #SsoAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the queryMethods() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_service_complete_query_methods() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-query-methods", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthServiceIface, handle_query_methods), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * SsoAuthService::handle-query-mechanisms: + * @object: A #SsoAuthService. + * @invocation: A #GDBusMethodInvocation. + * @arg_method: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the queryMechanisms() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_service_complete_query_mechanisms() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-query-mechanisms", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthServiceIface, handle_query_mechanisms), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * SsoAuthService::handle-query-identities: + * @object: A #SsoAuthService. + * @invocation: A #GDBusMethodInvocation. + * @arg_filter: Argument passed by remote caller. + * @arg_applicationContext: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the queryIdentities() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_service_complete_query_identities() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-query-identities", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthServiceIface, handle_query_identities), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING); + + /** + * SsoAuthService::handle-clear: + * @object: A #SsoAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the clear() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_service_complete_clear() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-clear", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthServiceIface, handle_clear), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * SsoAuthService::handle-backup-starts: + * @object: A #SsoAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the backupStarts() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_service_complete_backup_starts() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-backup-starts", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthServiceIface, handle_backup_starts), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * SsoAuthService::handle-backup-finished: + * @object: A #SsoAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the backupFinished() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_service_complete_backup_finished() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-backup-finished", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthServiceIface, handle_backup_finished), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * SsoAuthService::handle-restore-starts: + * @object: A #SsoAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the restoreStarts() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_service_complete_restore_starts() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-restore-starts", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthServiceIface, handle_restore_starts), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * SsoAuthService::handle-restore-finished: + * @object: A #SsoAuthService. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the restoreFinished() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_service_complete_restore_finished() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-restore-finished", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthServiceIface, handle_restore_finished), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + +} + +typedef SsoAuthServiceIface SsoAuthServiceInterface; +G_DEFINE_INTERFACE (SsoAuthService, sso_auth_service, G_TYPE_OBJECT); + +/** + * sso_auth_service_call_register_new_identity: + * @proxy: A #SsoAuthServiceProxy. + * @arg_applicationContext: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the registerNewIdentity() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_call_register_new_identity_finish() to get the result of the operation. + * + * See sso_auth_service_call_register_new_identity_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_service_call_register_new_identity ( + SsoAuthService *proxy, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "registerNewIdentity", + g_variant_new ("(s)", + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_service_call_register_new_identity_finish: + * @proxy: A #SsoAuthServiceProxy. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_call_register_new_identity(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_service_call_register_new_identity(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_register_new_identity_finish ( + SsoAuthService *proxy, + gchar **out_objectPath, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_objectPath); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_register_new_identity_sync: + * @proxy: A #SsoAuthServiceProxy. + * @arg_applicationContext: Argument to pass with the method invocation. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the registerNewIdentity() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_service_call_register_new_identity() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_register_new_identity_sync ( + SsoAuthService *proxy, + const gchar *arg_applicationContext, + gchar **out_objectPath, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "registerNewIdentity", + g_variant_new ("(s)", + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_objectPath); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_get_identity: + * @proxy: A #SsoAuthServiceProxy. + * @arg_id: Argument to pass with the method invocation. + * @arg_applicationContext: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the getIdentity() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_call_get_identity_finish() to get the result of the operation. + * + * See sso_auth_service_call_get_identity_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_service_call_get_identity ( + SsoAuthService *proxy, + guint arg_id, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "getIdentity", + g_variant_new ("(us)", + arg_id, + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_service_call_get_identity_finish: + * @proxy: A #SsoAuthServiceProxy. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @out_identityData: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_call_get_identity(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_service_call_get_identity(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_get_identity_finish ( + SsoAuthService *proxy, + gchar **out_objectPath, + GVariant **out_identityData, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o@a{sv})", + out_objectPath, + out_identityData); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_get_identity_sync: + * @proxy: A #SsoAuthServiceProxy. + * @arg_id: Argument to pass with the method invocation. + * @arg_applicationContext: Argument to pass with the method invocation. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @out_identityData: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the getIdentity() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_service_call_get_identity() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_get_identity_sync ( + SsoAuthService *proxy, + guint arg_id, + const gchar *arg_applicationContext, + gchar **out_objectPath, + GVariant **out_identityData, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "getIdentity", + g_variant_new ("(us)", + arg_id, + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o@a{sv})", + out_objectPath, + out_identityData); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_query_methods: + * @proxy: A #SsoAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the queryMethods() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_call_query_methods_finish() to get the result of the operation. + * + * See sso_auth_service_call_query_methods_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_service_call_query_methods ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "queryMethods", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_service_call_query_methods_finish: + * @proxy: A #SsoAuthServiceProxy. + * @out_authMethods: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_call_query_methods(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_service_call_query_methods(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_query_methods_finish ( + SsoAuthService *proxy, + gchar ***out_authMethods, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_authMethods); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_query_methods_sync: + * @proxy: A #SsoAuthServiceProxy. + * @out_authMethods: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the queryMethods() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_service_call_query_methods() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_query_methods_sync ( + SsoAuthService *proxy, + gchar ***out_authMethods, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "queryMethods", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_authMethods); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_query_mechanisms: + * @proxy: A #SsoAuthServiceProxy. + * @arg_method: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the queryMechanisms() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_call_query_mechanisms_finish() to get the result of the operation. + * + * See sso_auth_service_call_query_mechanisms_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_service_call_query_mechanisms ( + SsoAuthService *proxy, + const gchar *arg_method, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "queryMechanisms", + g_variant_new ("(s)", + arg_method), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_service_call_query_mechanisms_finish: + * @proxy: A #SsoAuthServiceProxy. + * @out_mechanisms: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_call_query_mechanisms(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_service_call_query_mechanisms(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_query_mechanisms_finish ( + SsoAuthService *proxy, + gchar ***out_mechanisms, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_mechanisms); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_query_mechanisms_sync: + * @proxy: A #SsoAuthServiceProxy. + * @arg_method: Argument to pass with the method invocation. + * @out_mechanisms: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the queryMechanisms() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_service_call_query_mechanisms() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_query_mechanisms_sync ( + SsoAuthService *proxy, + const gchar *arg_method, + gchar ***out_mechanisms, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "queryMechanisms", + g_variant_new ("(s)", + arg_method), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_mechanisms); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_query_identities: + * @proxy: A #SsoAuthServiceProxy. + * @arg_filter: Argument to pass with the method invocation. + * @arg_applicationContext: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the queryIdentities() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_call_query_identities_finish() to get the result of the operation. + * + * See sso_auth_service_call_query_identities_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_service_call_query_identities ( + SsoAuthService *proxy, + GVariant *arg_filter, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "queryIdentities", + g_variant_new ("(@a{sv}s)", + arg_filter, + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_service_call_query_identities_finish: + * @proxy: A #SsoAuthServiceProxy. + * @out_identities: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_call_query_identities(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_service_call_query_identities(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_query_identities_finish ( + SsoAuthService *proxy, + GVariant **out_identities, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@aa{sv})", + out_identities); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_query_identities_sync: + * @proxy: A #SsoAuthServiceProxy. + * @arg_filter: Argument to pass with the method invocation. + * @arg_applicationContext: Argument to pass with the method invocation. + * @out_identities: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the queryIdentities() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_service_call_query_identities() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_query_identities_sync ( + SsoAuthService *proxy, + GVariant *arg_filter, + const gchar *arg_applicationContext, + GVariant **out_identities, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "queryIdentities", + g_variant_new ("(@a{sv}s)", + arg_filter, + arg_applicationContext), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@aa{sv})", + out_identities); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_clear: + * @proxy: A #SsoAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the clear() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_call_clear_finish() to get the result of the operation. + * + * See sso_auth_service_call_clear_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_service_call_clear ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "clear", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_service_call_clear_finish: + * @proxy: A #SsoAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_call_clear(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_service_call_clear(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_clear_finish ( + SsoAuthService *proxy, + gboolean *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_clear_sync: + * @proxy: A #SsoAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the clear() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_service_call_clear() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_clear_sync ( + SsoAuthService *proxy, + gboolean *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "clear", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_backup_starts: + * @proxy: A #SsoAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the backupStarts() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_call_backup_starts_finish() to get the result of the operation. + * + * See sso_auth_service_call_backup_starts_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_service_call_backup_starts ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "backupStarts", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_service_call_backup_starts_finish: + * @proxy: A #SsoAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_call_backup_starts(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_service_call_backup_starts(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_backup_starts_finish ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_backup_starts_sync: + * @proxy: A #SsoAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the backupStarts() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_service_call_backup_starts() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_backup_starts_sync ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "backupStarts", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_backup_finished: + * @proxy: A #SsoAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the backupFinished() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_call_backup_finished_finish() to get the result of the operation. + * + * See sso_auth_service_call_backup_finished_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_service_call_backup_finished ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "backupFinished", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_service_call_backup_finished_finish: + * @proxy: A #SsoAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_call_backup_finished(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_service_call_backup_finished(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_backup_finished_finish ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_backup_finished_sync: + * @proxy: A #SsoAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the backupFinished() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_service_call_backup_finished() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_backup_finished_sync ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "backupFinished", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_restore_starts: + * @proxy: A #SsoAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the restoreStarts() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_call_restore_starts_finish() to get the result of the operation. + * + * See sso_auth_service_call_restore_starts_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_service_call_restore_starts ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "restoreStarts", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_service_call_restore_starts_finish: + * @proxy: A #SsoAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_call_restore_starts(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_service_call_restore_starts(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_restore_starts_finish ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_restore_starts_sync: + * @proxy: A #SsoAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the restoreStarts() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_service_call_restore_starts() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_restore_starts_sync ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "restoreStarts", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_restore_finished: + * @proxy: A #SsoAuthServiceProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the restoreFinished() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_call_restore_finished_finish() to get the result of the operation. + * + * See sso_auth_service_call_restore_finished_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_service_call_restore_finished ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "restoreFinished", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_service_call_restore_finished_finish: + * @proxy: A #SsoAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_call_restore_finished(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_service_call_restore_finished(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_restore_finished_finish ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_call_restore_finished_sync: + * @proxy: A #SsoAuthServiceProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the restoreFinished() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_service_call_restore_finished() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_service_call_restore_finished_sync ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "restoreFinished", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(y)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_service_complete_register_new_identity: + * @object: A #SsoAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @objectPath: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the registerNewIdentity() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_service_complete_register_new_identity ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(o)", + objectPath)); +} + +/** + * sso_auth_service_complete_get_identity: + * @object: A #SsoAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @objectPath: Parameter to return. + * @identityData: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the getIdentity() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_service_complete_get_identity ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath, + GVariant *identityData) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(o@a{sv})", + objectPath, + identityData)); +} + +/** + * sso_auth_service_complete_query_methods: + * @object: A #SsoAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @authMethods: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the queryMethods() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_service_complete_query_methods ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *const *authMethods) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(^as)", + authMethods)); +} + +/** + * sso_auth_service_complete_query_mechanisms: + * @object: A #SsoAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @mechanisms: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the queryMechanisms() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_service_complete_query_mechanisms ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *const *mechanisms) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(^as)", + mechanisms)); +} + +/** + * sso_auth_service_complete_query_identities: + * @object: A #SsoAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @identities: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the queryIdentities() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_service_complete_query_identities ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + GVariant *identities) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@aa{sv})", + identities)); +} + +/** + * sso_auth_service_complete_clear: + * @object: A #SsoAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the clear() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_service_complete_clear ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + unnamed_arg0)); +} + +/** + * sso_auth_service_complete_backup_starts: + * @object: A #SsoAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the backupStarts() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_service_complete_backup_starts ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(y)", + unnamed_arg0)); +} + +/** + * sso_auth_service_complete_backup_finished: + * @object: A #SsoAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the backupFinished() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_service_complete_backup_finished ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(y)", + unnamed_arg0)); +} + +/** + * sso_auth_service_complete_restore_starts: + * @object: A #SsoAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the restoreStarts() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_service_complete_restore_starts ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(y)", + unnamed_arg0)); +} + +/** + * sso_auth_service_complete_restore_finished: + * @object: A #SsoAuthService. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the restoreFinished() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_service_complete_restore_finished ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(y)", + unnamed_arg0)); +} + +/* ------------------------------------------------------------------------ */ + +/** + * SsoAuthServiceProxy: + * + * The #SsoAuthServiceProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * SsoAuthServiceProxyClass: + * @parent_class: The parent class. + * + * Class structure for #SsoAuthServiceProxy. + */ + +struct _SsoAuthServiceProxyPrivate +{ + GData *qdata; +}; + +static void sso_auth_service_proxy_iface_init (SsoAuthServiceIface *iface); + +G_DEFINE_TYPE_WITH_CODE (SsoAuthServiceProxy, sso_auth_service_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_SSO_AUTH_SERVICE, sso_auth_service_proxy_iface_init)); + +static void +sso_auth_service_proxy_finalize (GObject *object) +{ + SsoAuthServiceProxy *proxy = SSO_AUTH_SERVICE_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (sso_auth_service_proxy_parent_class)->finalize (object); +} + +static void +sso_auth_service_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ +} + +static void +sso_auth_service_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ +} + +static void +sso_auth_service_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_sso_auth_service_interface_info, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_SSO_AUTH_SERVICE); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_SSO_AUTH_SERVICE); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +sso_auth_service_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + SsoAuthServiceProxy *proxy = SSO_AUTH_SERVICE_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_auth_service_interface_info, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_auth_service_interface_info, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +sso_auth_service_proxy_init (SsoAuthServiceProxy *proxy) +{ + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_SSO_AUTH_SERVICE_PROXY, SsoAuthServiceProxyPrivate); + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), sso_auth_service_interface_info ()); +} + +static void +sso_auth_service_proxy_class_init (SsoAuthServiceProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + g_type_class_add_private (klass, sizeof (SsoAuthServiceProxyPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = sso_auth_service_proxy_finalize; + gobject_class->get_property = sso_auth_service_proxy_get_property; + gobject_class->set_property = sso_auth_service_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = sso_auth_service_proxy_g_signal; + proxy_class->g_properties_changed = sso_auth_service_proxy_g_properties_changed; + +} + +static void +sso_auth_service_proxy_iface_init (SsoAuthServiceIface *iface) +{ +} + +/** + * sso_auth_service_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.AuthService. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_proxy_new_finish() to get the result of the operation. + * + * See sso_auth_service_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +sso_auth_service_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_SSO_AUTH_SERVICE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthService", NULL); +} + +/** + * sso_auth_service_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with sso_auth_service_proxy_new(). + * + * Returns: (transfer full) (type SsoAuthServiceProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoAuthService * +sso_auth_service_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return SSO_AUTH_SERVICE (ret); + else + return NULL; +} + +/** + * sso_auth_service_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.AuthService. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See sso_auth_service_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type SsoAuthServiceProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoAuthService * +sso_auth_service_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_SSO_AUTH_SERVICE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthService", NULL); + if (ret != NULL) + return SSO_AUTH_SERVICE (ret); + else + return NULL; +} + + +/** + * sso_auth_service_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like sso_auth_service_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_service_proxy_new_for_bus_finish() to get the result of the operation. + * + * See sso_auth_service_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +sso_auth_service_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_SSO_AUTH_SERVICE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthService", NULL); +} + +/** + * sso_auth_service_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_service_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with sso_auth_service_proxy_new_for_bus(). + * + * Returns: (transfer full) (type SsoAuthServiceProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoAuthService * +sso_auth_service_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return SSO_AUTH_SERVICE (ret); + else + return NULL; +} + +/** + * sso_auth_service_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like sso_auth_service_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See sso_auth_service_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type SsoAuthServiceProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoAuthService * +sso_auth_service_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_SSO_AUTH_SERVICE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthService", NULL); + if (ret != NULL) + return SSO_AUTH_SERVICE (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * SsoAuthServiceSkeleton: + * + * The #SsoAuthServiceSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * SsoAuthServiceSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #SsoAuthServiceSkeleton. + */ + +struct _SsoAuthServiceSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_sso_auth_service_skeleton_handle_method_call ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + SsoAuthServiceSkeleton *skeleton = SSO_AUTH_SERVICE_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_SSO_AUTH_SERVICE); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_SSO_AUTH_SERVICE); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_sso_auth_service_skeleton_handle_get_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + SsoAuthServiceSkeleton *skeleton = SSO_AUTH_SERVICE_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_auth_service_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_sso_auth_service_skeleton_handle_set_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + SsoAuthServiceSkeleton *skeleton = SSO_AUTH_SERVICE_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_auth_service_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _sso_auth_service_skeleton_vtable = +{ + _sso_auth_service_skeleton_handle_method_call, + _sso_auth_service_skeleton_handle_get_property, + _sso_auth_service_skeleton_handle_set_property +}; + +static GDBusInterfaceInfo * +sso_auth_service_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton) +{ + return sso_auth_service_interface_info (); +} + +static GDBusInterfaceVTable * +sso_auth_service_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton) +{ + return (GDBusInterfaceVTable *) &_sso_auth_service_skeleton_vtable; +} + +static GVariant * +sso_auth_service_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + SsoAuthServiceSkeleton *skeleton = SSO_AUTH_SERVICE_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_sso_auth_service_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _sso_auth_service_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _sso_auth_service_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _sso_auth_service_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.AuthService", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +sso_auth_service_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void sso_auth_service_skeleton_iface_init (SsoAuthServiceIface *iface); +G_DEFINE_TYPE_WITH_CODE (SsoAuthServiceSkeleton, sso_auth_service_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_SSO_AUTH_SERVICE, sso_auth_service_skeleton_iface_init)); + +static void +sso_auth_service_skeleton_finalize (GObject *object) +{ + SsoAuthServiceSkeleton *skeleton = SSO_AUTH_SERVICE_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (sso_auth_service_skeleton_parent_class)->finalize (object); +} + +static void +sso_auth_service_skeleton_init (SsoAuthServiceSkeleton *skeleton) +{ + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_SSO_AUTH_SERVICE_SKELETON, SsoAuthServiceSkeletonPrivate); + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +sso_auth_service_skeleton_class_init (SsoAuthServiceSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + g_type_class_add_private (klass, sizeof (SsoAuthServiceSkeletonPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = sso_auth_service_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = sso_auth_service_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = sso_auth_service_skeleton_dbus_interface_get_properties; + skeleton_class->flush = sso_auth_service_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = sso_auth_service_skeleton_dbus_interface_get_vtable; +} + +static void +sso_auth_service_skeleton_iface_init (SsoAuthServiceIface *iface) +{ +} + +/** + * sso_auth_service_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.AuthService. + * + * Returns: (transfer full) (type SsoAuthServiceSkeleton): The skeleton object. + */ +SsoAuthService * +sso_auth_service_skeleton_new (void) +{ + return SSO_AUTH_SERVICE (g_object_new (TYPE_SSO_AUTH_SERVICE_SKELETON, NULL)); +} + diff --git a/libgsignon-glib/sso-auth-service-gen.h b/libgsignon-glib/sso-auth-service-gen.h new file mode 100644 index 0000000..e524010 --- /dev/null +++ b/libgsignon-glib/sso-auth-service-gen.h @@ -0,0 +1,434 @@ +/* + * Generated by gdbus-codegen 2.32.4. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __SSO_AUTH_SERVICE_GEN_H__ +#define __SSO_AUTH_SERVICE_GEN_H__ + +#include + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for com.google.code.AccountsSSO.gSingleSignOn.AuthService */ + +#define TYPE_SSO_AUTH_SERVICE (sso_auth_service_get_type ()) +#define SSO_AUTH_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SSO_AUTH_SERVICE, SsoAuthService)) +#define IS_SSO_AUTH_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SSO_AUTH_SERVICE)) +#define SSO_AUTH_SERVICE_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_SSO_AUTH_SERVICE, SsoAuthServiceIface)) + +struct _SsoAuthService; +typedef struct _SsoAuthService SsoAuthService; +typedef struct _SsoAuthServiceIface SsoAuthServiceIface; + +struct _SsoAuthServiceIface +{ + GTypeInterface parent_iface; + + gboolean (*handle_backup_finished) ( + SsoAuthService *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_backup_starts) ( + SsoAuthService *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_clear) ( + SsoAuthService *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_get_identity) ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + guint arg_id, + const gchar *arg_applicationContext); + + gboolean (*handle_query_identities) ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + GVariant *arg_filter, + const gchar *arg_applicationContext); + + gboolean (*handle_query_mechanisms) ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *arg_method); + + gboolean (*handle_query_methods) ( + SsoAuthService *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_register_new_identity) ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *arg_applicationContext); + + gboolean (*handle_restore_finished) ( + SsoAuthService *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_restore_starts) ( + SsoAuthService *object, + GDBusMethodInvocation *invocation); + +}; + +GType sso_auth_service_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *sso_auth_service_interface_info (void); +guint sso_auth_service_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void sso_auth_service_complete_register_new_identity ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath); + +void sso_auth_service_complete_get_identity ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath, + GVariant *identityData); + +void sso_auth_service_complete_query_methods ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *const *authMethods); + +void sso_auth_service_complete_query_mechanisms ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + const gchar *const *mechanisms); + +void sso_auth_service_complete_query_identities ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + GVariant *identities); + +void sso_auth_service_complete_clear ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg0); + +void sso_auth_service_complete_backup_starts ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0); + +void sso_auth_service_complete_backup_finished ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0); + +void sso_auth_service_complete_restore_starts ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0); + +void sso_auth_service_complete_restore_finished ( + SsoAuthService *object, + GDBusMethodInvocation *invocation, + guchar unnamed_arg0); + + + +/* D-Bus method calls: */ +void sso_auth_service_call_register_new_identity ( + SsoAuthService *proxy, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_service_call_register_new_identity_finish ( + SsoAuthService *proxy, + gchar **out_objectPath, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_service_call_register_new_identity_sync ( + SsoAuthService *proxy, + const gchar *arg_applicationContext, + gchar **out_objectPath, + GCancellable *cancellable, + GError **error); + +void sso_auth_service_call_get_identity ( + SsoAuthService *proxy, + guint arg_id, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_service_call_get_identity_finish ( + SsoAuthService *proxy, + gchar **out_objectPath, + GVariant **out_identityData, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_service_call_get_identity_sync ( + SsoAuthService *proxy, + guint arg_id, + const gchar *arg_applicationContext, + gchar **out_objectPath, + GVariant **out_identityData, + GCancellable *cancellable, + GError **error); + +void sso_auth_service_call_query_methods ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_service_call_query_methods_finish ( + SsoAuthService *proxy, + gchar ***out_authMethods, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_service_call_query_methods_sync ( + SsoAuthService *proxy, + gchar ***out_authMethods, + GCancellable *cancellable, + GError **error); + +void sso_auth_service_call_query_mechanisms ( + SsoAuthService *proxy, + const gchar *arg_method, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_service_call_query_mechanisms_finish ( + SsoAuthService *proxy, + gchar ***out_mechanisms, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_service_call_query_mechanisms_sync ( + SsoAuthService *proxy, + const gchar *arg_method, + gchar ***out_mechanisms, + GCancellable *cancellable, + GError **error); + +void sso_auth_service_call_query_identities ( + SsoAuthService *proxy, + GVariant *arg_filter, + const gchar *arg_applicationContext, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_service_call_query_identities_finish ( + SsoAuthService *proxy, + GVariant **out_identities, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_service_call_query_identities_sync ( + SsoAuthService *proxy, + GVariant *arg_filter, + const gchar *arg_applicationContext, + GVariant **out_identities, + GCancellable *cancellable, + GError **error); + +void sso_auth_service_call_clear ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_service_call_clear_finish ( + SsoAuthService *proxy, + gboolean *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_service_call_clear_sync ( + SsoAuthService *proxy, + gboolean *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + +void sso_auth_service_call_backup_starts ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_service_call_backup_starts_finish ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_service_call_backup_starts_sync ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + +void sso_auth_service_call_backup_finished ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_service_call_backup_finished_finish ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_service_call_backup_finished_sync ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + +void sso_auth_service_call_restore_starts ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_service_call_restore_starts_finish ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_service_call_restore_starts_sync ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + +void sso_auth_service_call_restore_finished ( + SsoAuthService *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_service_call_restore_finished_finish ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_service_call_restore_finished_sync ( + SsoAuthService *proxy, + guchar *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define TYPE_SSO_AUTH_SERVICE_PROXY (sso_auth_service_proxy_get_type ()) +#define SSO_AUTH_SERVICE_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SSO_AUTH_SERVICE_PROXY, SsoAuthServiceProxy)) +#define SSO_AUTH_SERVICE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SSO_AUTH_SERVICE_PROXY, SsoAuthServiceProxyClass)) +#define SSO_AUTH_SERVICE_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SSO_AUTH_SERVICE_PROXY, SsoAuthServiceProxyClass)) +#define IS_SSO_AUTH_SERVICE_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SSO_AUTH_SERVICE_PROXY)) +#define IS_SSO_AUTH_SERVICE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SSO_AUTH_SERVICE_PROXY)) + +typedef struct _SsoAuthServiceProxy SsoAuthServiceProxy; +typedef struct _SsoAuthServiceProxyClass SsoAuthServiceProxyClass; +typedef struct _SsoAuthServiceProxyPrivate SsoAuthServiceProxyPrivate; + +struct _SsoAuthServiceProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + SsoAuthServiceProxyPrivate *priv; +}; + +struct _SsoAuthServiceProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType sso_auth_service_proxy_get_type (void) G_GNUC_CONST; + +void sso_auth_service_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +SsoAuthService *sso_auth_service_proxy_new_finish ( + GAsyncResult *res, + GError **error); +SsoAuthService *sso_auth_service_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void sso_auth_service_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +SsoAuthService *sso_auth_service_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +SsoAuthService *sso_auth_service_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_SSO_AUTH_SERVICE_SKELETON (sso_auth_service_skeleton_get_type ()) +#define SSO_AUTH_SERVICE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SSO_AUTH_SERVICE_SKELETON, SsoAuthServiceSkeleton)) +#define SSO_AUTH_SERVICE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SSO_AUTH_SERVICE_SKELETON, SsoAuthServiceSkeletonClass)) +#define SSO_AUTH_SERVICE_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SSO_AUTH_SERVICE_SKELETON, SsoAuthServiceSkeletonClass)) +#define IS_SSO_AUTH_SERVICE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SSO_AUTH_SERVICE_SKELETON)) +#define IS_SSO_AUTH_SERVICE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SSO_AUTH_SERVICE_SKELETON)) + +typedef struct _SsoAuthServiceSkeleton SsoAuthServiceSkeleton; +typedef struct _SsoAuthServiceSkeletonClass SsoAuthServiceSkeletonClass; +typedef struct _SsoAuthServiceSkeletonPrivate SsoAuthServiceSkeletonPrivate; + +struct _SsoAuthServiceSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + SsoAuthServiceSkeletonPrivate *priv; +}; + +struct _SsoAuthServiceSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType sso_auth_service_skeleton_get_type (void) G_GNUC_CONST; + +SsoAuthService *sso_auth_service_skeleton_new (void); + + +G_END_DECLS + +#endif /* __SSO_AUTH_SERVICE_GEN_H__ */ diff --git a/libgsignon-glib/sso-auth-session-gen.c b/libgsignon-glib/sso-auth-session-gen.c new file mode 100644 index 0000000..8b3cd34 --- /dev/null +++ b/libgsignon-glib/sso-auth-session-gen.c @@ -0,0 +1,1591 @@ +/* + * Generated by gdbus-codegen 2.32.4. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "sso-auth-session-gen.h" + +#include +#ifdef G_OS_UNIX +# include +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface com.google.code.AccountsSSO.gSingleSignOn.AuthSession + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:SsoAuthSession + * @title: SsoAuthSession + * @short_description: Generated C code for the com.google.code.AccountsSSO.gSingleSignOn.AuthSession D-Bus interface + * + * This section contains code for working with the com.google.code.AccountsSSO.gSingleSignOn.AuthSession D-Bus interface in C. + */ + +/* ---- Introspection data for com.google.code.AccountsSSO.gSingleSignOn.AuthSession ---- */ + +static const _ExtendedGDBusArgInfo _sso_auth_session_method_info_query_available_mechanisms_IN_ARG_wantedMechanisms = +{ + { + -1, + "wantedMechanisms", + "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_session_method_info_query_available_mechanisms_IN_ARG_pointers[] = +{ + &_sso_auth_session_method_info_query_available_mechanisms_IN_ARG_wantedMechanisms, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_auth_session_method_info_query_available_mechanisms_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "as", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_session_method_info_query_available_mechanisms_OUT_ARG_pointers[] = +{ + &_sso_auth_session_method_info_query_available_mechanisms_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_session_method_info_query_available_mechanisms = +{ + { + -1, + "queryAvailableMechanisms", + (GDBusArgInfo **) &_sso_auth_session_method_info_query_available_mechanisms_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_auth_session_method_info_query_available_mechanisms_OUT_ARG_pointers, + NULL + }, + "handle-query-available-mechanisms", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_session_method_info_process_IN_ARG_sessionDataVa = +{ + { + -1, + "sessionDataVa", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_session_method_info_process_IN_ARG_mechanism = +{ + { + -1, + "mechanism", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_session_method_info_process_IN_ARG_pointers[] = +{ + &_sso_auth_session_method_info_process_IN_ARG_sessionDataVa, + &_sso_auth_session_method_info_process_IN_ARG_mechanism, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_auth_session_method_info_process_OUT_ARG_unnamed_arg2 = +{ + { + -1, + "unnamed_arg2", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_session_method_info_process_OUT_ARG_pointers[] = +{ + &_sso_auth_session_method_info_process_OUT_ARG_unnamed_arg2, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_session_method_info_process = +{ + { + -1, + "process", + (GDBusArgInfo **) &_sso_auth_session_method_info_process_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_auth_session_method_info_process_OUT_ARG_pointers, + NULL + }, + "handle-process", + FALSE +}; + +static const GDBusAnnotationInfo _sso_auth_session_method_cancel_annotation_info_0 = +{ + -1, + "org.freedesktop.DBus.Method.NoReply", + "true", + NULL +}; + +static const GDBusAnnotationInfo * const _sso_auth_session_method_cancel_annotation_info_pointers[] = +{ + &_sso_auth_session_method_cancel_annotation_info_0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_auth_session_method_info_cancel = +{ + { + -1, + "cancel", + NULL, + NULL, + (GDBusAnnotationInfo **) &_sso_auth_session_method_cancel_annotation_info_pointers + }, + "handle-cancel", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _sso_auth_session_method_info_pointers[] = +{ + &_sso_auth_session_method_info_query_available_mechanisms, + &_sso_auth_session_method_info_process, + &_sso_auth_session_method_info_cancel, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_auth_session_signal_info_state_changed_ARG_state = +{ + { + -1, + "state", + "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_auth_session_signal_info_state_changed_ARG_message = +{ + { + -1, + "message", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_auth_session_signal_info_state_changed_ARG_pointers[] = +{ + &_sso_auth_session_signal_info_state_changed_ARG_state, + &_sso_auth_session_signal_info_state_changed_ARG_message, + NULL +}; + +static const _ExtendedGDBusSignalInfo _sso_auth_session_signal_info_state_changed = +{ + { + -1, + "stateChanged", + (GDBusArgInfo **) &_sso_auth_session_signal_info_state_changed_ARG_pointers, + NULL + }, + "state-changed" +}; + +static const _ExtendedGDBusSignalInfo _sso_auth_session_signal_info_unregistered = +{ + { + -1, + "unregistered", + NULL, + NULL + }, + "unregistered" +}; + +static const _ExtendedGDBusSignalInfo * const _sso_auth_session_signal_info_pointers[] = +{ + &_sso_auth_session_signal_info_state_changed, + &_sso_auth_session_signal_info_unregistered, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _sso_auth_session_interface_info = +{ + { + -1, + "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", + (GDBusMethodInfo **) &_sso_auth_session_method_info_pointers, + (GDBusSignalInfo **) &_sso_auth_session_signal_info_pointers, + NULL, + NULL + }, + "sso-auth-session", +}; + + +/** + * sso_auth_session_interface_info: + * + * Gets a machine-readable description of the com.google.code.AccountsSSO.gSingleSignOn.AuthSession D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +sso_auth_session_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_sso_auth_session_interface_info; +} + +/** + * sso_auth_session_override_properties: + * @klass: The class structure for a #GObject-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #SsoAuthSession interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +sso_auth_session_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * SsoAuthSession: + * + * Abstract interface type for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.AuthSession. + */ + +/** + * SsoAuthSessionIface: + * @parent_iface: The parent interface. + * @handle_cancel: Handler for the #SsoAuthSession::handle-cancel signal. + * @handle_process: Handler for the #SsoAuthSession::handle-process signal. + * @handle_query_available_mechanisms: Handler for the #SsoAuthSession::handle-query-available-mechanisms signal. + * @state_changed: Handler for the #SsoAuthSession::state-changed signal. + * @unregistered: Handler for the #SsoAuthSession::unregistered signal. + * + * Virtual table for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.AuthSession. + */ + +static void +sso_auth_session_default_init (SsoAuthSessionIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * SsoAuthSession::handle-query-available-mechanisms: + * @object: A #SsoAuthSession. + * @invocation: A #GDBusMethodInvocation. + * @arg_wantedMechanisms: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the queryAvailableMechanisms() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_session_complete_query_available_mechanisms() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-query-available-mechanisms", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthSessionIface, handle_query_available_mechanisms), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRV); + + /** + * SsoAuthSession::handle-process: + * @object: A #SsoAuthSession. + * @invocation: A #GDBusMethodInvocation. + * @arg_sessionDataVa: Argument passed by remote caller. + * @arg_mechanism: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the process() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_session_complete_process() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-process", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthSessionIface, handle_process), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING); + + /** + * SsoAuthSession::handle-cancel: + * @object: A #SsoAuthSession. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the cancel() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_auth_session_complete_cancel() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-cancel", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthSessionIface, handle_cancel), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /* GObject signals for received D-Bus signals: */ + /** + * SsoAuthSession::state-changed: + * @object: A #SsoAuthSession. + * @arg_state: Argument. + * @arg_message: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "stateChanged" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("state-changed", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthSessionIface, state_changed), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, G_TYPE_INT, G_TYPE_STRING); + + /** + * SsoAuthSession::unregistered: + * @object: A #SsoAuthSession. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "unregistered" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("unregistered", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoAuthSessionIface, unregistered), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); + +} + +typedef SsoAuthSessionIface SsoAuthSessionInterface; +G_DEFINE_INTERFACE (SsoAuthSession, sso_auth_session, G_TYPE_OBJECT); + +/** + * sso_auth_session_emit_state_changed: + * @object: A #SsoAuthSession. + * @arg_state: Argument to pass with the signal. + * @arg_message: Argument to pass with the signal. + * + * Emits the "stateChanged" D-Bus signal. + */ +void +sso_auth_session_emit_state_changed ( + SsoAuthSession *object, + gint arg_state, + const gchar *arg_message) +{ + g_signal_emit_by_name (object, "state-changed", arg_state, arg_message); +} + +/** + * sso_auth_session_emit_unregistered: + * @object: A #SsoAuthSession. + * + * Emits the "unregistered" D-Bus signal. + */ +void +sso_auth_session_emit_unregistered ( + SsoAuthSession *object) +{ + g_signal_emit_by_name (object, "unregistered"); +} + +/** + * sso_auth_session_call_query_available_mechanisms: + * @proxy: A #SsoAuthSessionProxy. + * @arg_wantedMechanisms: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the queryAvailableMechanisms() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_session_call_query_available_mechanisms_finish() to get the result of the operation. + * + * See sso_auth_session_call_query_available_mechanisms_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_session_call_query_available_mechanisms ( + SsoAuthSession *proxy, + const gchar *const *arg_wantedMechanisms, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "queryAvailableMechanisms", + g_variant_new ("(^as)", + arg_wantedMechanisms), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_session_call_query_available_mechanisms_finish: + * @proxy: A #SsoAuthSessionProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_session_call_query_available_mechanisms(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_session_call_query_available_mechanisms(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_session_call_query_available_mechanisms_finish ( + SsoAuthSession *proxy, + gchar ***out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_session_call_query_available_mechanisms_sync: + * @proxy: A #SsoAuthSessionProxy. + * @arg_wantedMechanisms: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the queryAvailableMechanisms() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_session_call_query_available_mechanisms() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_session_call_query_available_mechanisms_sync ( + SsoAuthSession *proxy, + const gchar *const *arg_wantedMechanisms, + gchar ***out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "queryAvailableMechanisms", + g_variant_new ("(^as)", + arg_wantedMechanisms), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(^as)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_session_call_process: + * @proxy: A #SsoAuthSessionProxy. + * @arg_sessionDataVa: Argument to pass with the method invocation. + * @arg_mechanism: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the process() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_session_call_process_finish() to get the result of the operation. + * + * See sso_auth_session_call_process_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_session_call_process ( + SsoAuthSession *proxy, + GVariant *arg_sessionDataVa, + const gchar *arg_mechanism, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "process", + g_variant_new ("(@a{sv}s)", + arg_sessionDataVa, + arg_mechanism), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_session_call_process_finish: + * @proxy: A #SsoAuthSessionProxy. + * @out_unnamed_arg2: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_session_call_process(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_session_call_process(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_session_call_process_finish ( + SsoAuthSession *proxy, + GVariant **out_unnamed_arg2, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_unnamed_arg2); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_session_call_process_sync: + * @proxy: A #SsoAuthSessionProxy. + * @arg_sessionDataVa: Argument to pass with the method invocation. + * @arg_mechanism: Argument to pass with the method invocation. + * @out_unnamed_arg2: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the process() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_session_call_process() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_session_call_process_sync ( + SsoAuthSession *proxy, + GVariant *arg_sessionDataVa, + const gchar *arg_mechanism, + GVariant **out_unnamed_arg2, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "process", + g_variant_new ("(@a{sv}s)", + arg_sessionDataVa, + arg_mechanism), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_unnamed_arg2); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_session_call_cancel: + * @proxy: A #SsoAuthSessionProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the cancel() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_session_call_cancel_finish() to get the result of the operation. + * + * See sso_auth_session_call_cancel_sync() for the synchronous, blocking version of this method. + */ +void +sso_auth_session_call_cancel ( + SsoAuthSession *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "cancel", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_auth_session_call_cancel_finish: + * @proxy: A #SsoAuthSessionProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_session_call_cancel(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_auth_session_call_cancel(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_session_call_cancel_finish ( + SsoAuthSession *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_session_call_cancel_sync: + * @proxy: A #SsoAuthSessionProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the cancel() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_auth_session_call_cancel() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_auth_session_call_cancel_sync ( + SsoAuthSession *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "cancel", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_auth_session_complete_query_available_mechanisms: + * @object: A #SsoAuthSession. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the queryAvailableMechanisms() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_session_complete_query_available_mechanisms ( + SsoAuthSession *object, + GDBusMethodInvocation *invocation, + const gchar *const *unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(^as)", + unnamed_arg1)); +} + +/** + * sso_auth_session_complete_process: + * @object: A #SsoAuthSession. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg2: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the process() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_session_complete_process ( + SsoAuthSession *object, + GDBusMethodInvocation *invocation, + GVariant *unnamed_arg2) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a{sv})", + unnamed_arg2)); +} + +/** + * sso_auth_session_complete_cancel: + * @object: A #SsoAuthSession. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the cancel() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_auth_session_complete_cancel ( + SsoAuthSession *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/* ------------------------------------------------------------------------ */ + +/** + * SsoAuthSessionProxy: + * + * The #SsoAuthSessionProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * SsoAuthSessionProxyClass: + * @parent_class: The parent class. + * + * Class structure for #SsoAuthSessionProxy. + */ + +struct _SsoAuthSessionProxyPrivate +{ + GData *qdata; +}; + +static void sso_auth_session_proxy_iface_init (SsoAuthSessionIface *iface); + +G_DEFINE_TYPE_WITH_CODE (SsoAuthSessionProxy, sso_auth_session_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_SSO_AUTH_SESSION, sso_auth_session_proxy_iface_init)); + +static void +sso_auth_session_proxy_finalize (GObject *object) +{ + SsoAuthSessionProxy *proxy = SSO_AUTH_SESSION_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (sso_auth_session_proxy_parent_class)->finalize (object); +} + +static void +sso_auth_session_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ +} + +static void +sso_auth_session_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ +} + +static void +sso_auth_session_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_sso_auth_session_interface_info, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_SSO_AUTH_SESSION); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_SSO_AUTH_SESSION); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +sso_auth_session_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + SsoAuthSessionProxy *proxy = SSO_AUTH_SESSION_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_auth_session_interface_info, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_auth_session_interface_info, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +sso_auth_session_proxy_init (SsoAuthSessionProxy *proxy) +{ + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_SSO_AUTH_SESSION_PROXY, SsoAuthSessionProxyPrivate); + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), sso_auth_session_interface_info ()); +} + +static void +sso_auth_session_proxy_class_init (SsoAuthSessionProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + g_type_class_add_private (klass, sizeof (SsoAuthSessionProxyPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = sso_auth_session_proxy_finalize; + gobject_class->get_property = sso_auth_session_proxy_get_property; + gobject_class->set_property = sso_auth_session_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = sso_auth_session_proxy_g_signal; + proxy_class->g_properties_changed = sso_auth_session_proxy_g_properties_changed; + +} + +static void +sso_auth_session_proxy_iface_init (SsoAuthSessionIface *iface) +{ +} + +/** + * sso_auth_session_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.AuthSession. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_session_proxy_new_finish() to get the result of the operation. + * + * See sso_auth_session_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +sso_auth_session_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_SSO_AUTH_SESSION_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", NULL); +} + +/** + * sso_auth_session_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_session_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with sso_auth_session_proxy_new(). + * + * Returns: (transfer full) (type SsoAuthSessionProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoAuthSession * +sso_auth_session_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return SSO_AUTH_SESSION (ret); + else + return NULL; +} + +/** + * sso_auth_session_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.AuthSession. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See sso_auth_session_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type SsoAuthSessionProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoAuthSession * +sso_auth_session_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_SSO_AUTH_SESSION_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", NULL); + if (ret != NULL) + return SSO_AUTH_SESSION (ret); + else + return NULL; +} + + +/** + * sso_auth_session_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like sso_auth_session_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_auth_session_proxy_new_for_bus_finish() to get the result of the operation. + * + * See sso_auth_session_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +sso_auth_session_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_SSO_AUTH_SESSION_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", NULL); +} + +/** + * sso_auth_session_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_auth_session_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with sso_auth_session_proxy_new_for_bus(). + * + * Returns: (transfer full) (type SsoAuthSessionProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoAuthSession * +sso_auth_session_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return SSO_AUTH_SESSION (ret); + else + return NULL; +} + +/** + * sso_auth_session_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like sso_auth_session_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See sso_auth_session_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type SsoAuthSessionProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoAuthSession * +sso_auth_session_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_SSO_AUTH_SESSION_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", NULL); + if (ret != NULL) + return SSO_AUTH_SESSION (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * SsoAuthSessionSkeleton: + * + * The #SsoAuthSessionSkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * SsoAuthSessionSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #SsoAuthSessionSkeleton. + */ + +struct _SsoAuthSessionSkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_sso_auth_session_skeleton_handle_method_call ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + SsoAuthSessionSkeleton *skeleton = SSO_AUTH_SESSION_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_SSO_AUTH_SESSION); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_SSO_AUTH_SESSION); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_sso_auth_session_skeleton_handle_get_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + SsoAuthSessionSkeleton *skeleton = SSO_AUTH_SESSION_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_auth_session_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_sso_auth_session_skeleton_handle_set_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + SsoAuthSessionSkeleton *skeleton = SSO_AUTH_SESSION_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_auth_session_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _sso_auth_session_skeleton_vtable = +{ + _sso_auth_session_skeleton_handle_method_call, + _sso_auth_session_skeleton_handle_get_property, + _sso_auth_session_skeleton_handle_set_property +}; + +static GDBusInterfaceInfo * +sso_auth_session_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton) +{ + return sso_auth_session_interface_info (); +} + +static GDBusInterfaceVTable * +sso_auth_session_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton) +{ + return (GDBusInterfaceVTable *) &_sso_auth_session_skeleton_vtable; +} + +static GVariant * +sso_auth_session_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + SsoAuthSessionSkeleton *skeleton = SSO_AUTH_SESSION_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_sso_auth_session_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _sso_auth_session_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _sso_auth_session_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _sso_auth_session_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +sso_auth_session_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_sso_auth_session_on_signal_state_changed ( + SsoAuthSession *object, + gint arg_state, + const gchar *arg_message) +{ + SsoAuthSessionSkeleton *skeleton = SSO_AUTH_SESSION_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(is)", + arg_state, + arg_message)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", "stateChanged", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_sso_auth_session_on_signal_unregistered ( + SsoAuthSession *object) +{ + SsoAuthSessionSkeleton *skeleton = SSO_AUTH_SESSION_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("()")); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.AuthSession", "unregistered", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void sso_auth_session_skeleton_iface_init (SsoAuthSessionIface *iface); +G_DEFINE_TYPE_WITH_CODE (SsoAuthSessionSkeleton, sso_auth_session_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_SSO_AUTH_SESSION, sso_auth_session_skeleton_iface_init)); + +static void +sso_auth_session_skeleton_finalize (GObject *object) +{ + SsoAuthSessionSkeleton *skeleton = SSO_AUTH_SESSION_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (sso_auth_session_skeleton_parent_class)->finalize (object); +} + +static void +sso_auth_session_skeleton_init (SsoAuthSessionSkeleton *skeleton) +{ + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_SSO_AUTH_SESSION_SKELETON, SsoAuthSessionSkeletonPrivate); + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +sso_auth_session_skeleton_class_init (SsoAuthSessionSkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + g_type_class_add_private (klass, sizeof (SsoAuthSessionSkeletonPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = sso_auth_session_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = sso_auth_session_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = sso_auth_session_skeleton_dbus_interface_get_properties; + skeleton_class->flush = sso_auth_session_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = sso_auth_session_skeleton_dbus_interface_get_vtable; +} + +static void +sso_auth_session_skeleton_iface_init (SsoAuthSessionIface *iface) +{ + iface->state_changed = _sso_auth_session_on_signal_state_changed; + iface->unregistered = _sso_auth_session_on_signal_unregistered; +} + +/** + * sso_auth_session_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.AuthSession. + * + * Returns: (transfer full) (type SsoAuthSessionSkeleton): The skeleton object. + */ +SsoAuthSession * +sso_auth_session_skeleton_new (void) +{ + return SSO_AUTH_SESSION (g_object_new (TYPE_SSO_AUTH_SESSION_SKELETON, NULL)); +} + diff --git a/libgsignon-glib/sso-auth-session-gen.h b/libgsignon-glib/sso-auth-session-gen.h new file mode 100644 index 0000000..74fb54c --- /dev/null +++ b/libgsignon-glib/sso-auth-session-gen.h @@ -0,0 +1,250 @@ +/* + * Generated by gdbus-codegen 2.32.4. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __SSO_AUTH_SESSION_GEN_H__ +#define __SSO_AUTH_SESSION_GEN_H__ + +#include + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for com.google.code.AccountsSSO.gSingleSignOn.AuthSession */ + +#define TYPE_SSO_AUTH_SESSION (sso_auth_session_get_type ()) +#define SSO_AUTH_SESSION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SSO_AUTH_SESSION, SsoAuthSession)) +#define IS_SSO_AUTH_SESSION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SSO_AUTH_SESSION)) +#define SSO_AUTH_SESSION_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_SSO_AUTH_SESSION, SsoAuthSessionIface)) + +struct _SsoAuthSession; +typedef struct _SsoAuthSession SsoAuthSession; +typedef struct _SsoAuthSessionIface SsoAuthSessionIface; + +struct _SsoAuthSessionIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_cancel) ( + SsoAuthSession *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_process) ( + SsoAuthSession *object, + GDBusMethodInvocation *invocation, + GVariant *arg_sessionDataVa, + const gchar *arg_mechanism); + + gboolean (*handle_query_available_mechanisms) ( + SsoAuthSession *object, + GDBusMethodInvocation *invocation, + const gchar *const *arg_wantedMechanisms); + + void (*state_changed) ( + SsoAuthSession *object, + gint arg_state, + const gchar *arg_message); + + void (*unregistered) ( + SsoAuthSession *object); + +}; + +GType sso_auth_session_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *sso_auth_session_interface_info (void); +guint sso_auth_session_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void sso_auth_session_complete_query_available_mechanisms ( + SsoAuthSession *object, + GDBusMethodInvocation *invocation, + const gchar *const *unnamed_arg1); + +void sso_auth_session_complete_process ( + SsoAuthSession *object, + GDBusMethodInvocation *invocation, + GVariant *unnamed_arg2); + +void sso_auth_session_complete_cancel ( + SsoAuthSession *object, + GDBusMethodInvocation *invocation); + + + +/* D-Bus signal emissions functions: */ +void sso_auth_session_emit_state_changed ( + SsoAuthSession *object, + gint arg_state, + const gchar *arg_message); + +void sso_auth_session_emit_unregistered ( + SsoAuthSession *object); + + + +/* D-Bus method calls: */ +void sso_auth_session_call_query_available_mechanisms ( + SsoAuthSession *proxy, + const gchar *const *arg_wantedMechanisms, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_session_call_query_available_mechanisms_finish ( + SsoAuthSession *proxy, + gchar ***out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_session_call_query_available_mechanisms_sync ( + SsoAuthSession *proxy, + const gchar *const *arg_wantedMechanisms, + gchar ***out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void sso_auth_session_call_process ( + SsoAuthSession *proxy, + GVariant *arg_sessionDataVa, + const gchar *arg_mechanism, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_session_call_process_finish ( + SsoAuthSession *proxy, + GVariant **out_unnamed_arg2, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_session_call_process_sync ( + SsoAuthSession *proxy, + GVariant *arg_sessionDataVa, + const gchar *arg_mechanism, + GVariant **out_unnamed_arg2, + GCancellable *cancellable, + GError **error); + +void sso_auth_session_call_cancel ( + SsoAuthSession *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_auth_session_call_cancel_finish ( + SsoAuthSession *proxy, + GAsyncResult *res, + GError **error); + +gboolean sso_auth_session_call_cancel_sync ( + SsoAuthSession *proxy, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define TYPE_SSO_AUTH_SESSION_PROXY (sso_auth_session_proxy_get_type ()) +#define SSO_AUTH_SESSION_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SSO_AUTH_SESSION_PROXY, SsoAuthSessionProxy)) +#define SSO_AUTH_SESSION_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SSO_AUTH_SESSION_PROXY, SsoAuthSessionProxyClass)) +#define SSO_AUTH_SESSION_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SSO_AUTH_SESSION_PROXY, SsoAuthSessionProxyClass)) +#define IS_SSO_AUTH_SESSION_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SSO_AUTH_SESSION_PROXY)) +#define IS_SSO_AUTH_SESSION_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SSO_AUTH_SESSION_PROXY)) + +typedef struct _SsoAuthSessionProxy SsoAuthSessionProxy; +typedef struct _SsoAuthSessionProxyClass SsoAuthSessionProxyClass; +typedef struct _SsoAuthSessionProxyPrivate SsoAuthSessionProxyPrivate; + +struct _SsoAuthSessionProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + SsoAuthSessionProxyPrivate *priv; +}; + +struct _SsoAuthSessionProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType sso_auth_session_proxy_get_type (void) G_GNUC_CONST; + +void sso_auth_session_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +SsoAuthSession *sso_auth_session_proxy_new_finish ( + GAsyncResult *res, + GError **error); +SsoAuthSession *sso_auth_session_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void sso_auth_session_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +SsoAuthSession *sso_auth_session_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +SsoAuthSession *sso_auth_session_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_SSO_AUTH_SESSION_SKELETON (sso_auth_session_skeleton_get_type ()) +#define SSO_AUTH_SESSION_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SSO_AUTH_SESSION_SKELETON, SsoAuthSessionSkeleton)) +#define SSO_AUTH_SESSION_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SSO_AUTH_SESSION_SKELETON, SsoAuthSessionSkeletonClass)) +#define SSO_AUTH_SESSION_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SSO_AUTH_SESSION_SKELETON, SsoAuthSessionSkeletonClass)) +#define IS_SSO_AUTH_SESSION_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SSO_AUTH_SESSION_SKELETON)) +#define IS_SSO_AUTH_SESSION_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SSO_AUTH_SESSION_SKELETON)) + +typedef struct _SsoAuthSessionSkeleton SsoAuthSessionSkeleton; +typedef struct _SsoAuthSessionSkeletonClass SsoAuthSessionSkeletonClass; +typedef struct _SsoAuthSessionSkeletonPrivate SsoAuthSessionSkeletonPrivate; + +struct _SsoAuthSessionSkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + SsoAuthSessionSkeletonPrivate *priv; +}; + +struct _SsoAuthSessionSkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType sso_auth_session_skeleton_get_type (void) G_GNUC_CONST; + +SsoAuthSession *sso_auth_session_skeleton_new (void); + + +G_END_DECLS + +#endif /* __SSO_AUTH_SESSION_GEN_H__ */ diff --git a/libgsignon-glib/sso-identity-gen.c b/libgsignon-glib/sso-identity-gen.c new file mode 100644 index 0000000..ba10501 --- /dev/null +++ b/libgsignon-glib/sso-identity-gen.c @@ -0,0 +1,2872 @@ +/* + * Generated by gdbus-codegen 2.32.4. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "sso-identity-gen.h" + +#include +#ifdef G_OS_UNIX +# include +#endif + +typedef struct +{ + GDBusArgInfo parent_struct; + gboolean use_gvariant; +} _ExtendedGDBusArgInfo; + +typedef struct +{ + GDBusMethodInfo parent_struct; + const gchar *signal_name; + gboolean pass_fdlist; +} _ExtendedGDBusMethodInfo; + +typedef struct +{ + GDBusSignalInfo parent_struct; + const gchar *signal_name; +} _ExtendedGDBusSignalInfo; + +typedef struct +{ + GDBusPropertyInfo parent_struct; + const gchar *hyphen_name; + gboolean use_gvariant; +} _ExtendedGDBusPropertyInfo; + +typedef struct +{ + GDBusInterfaceInfo parent_struct; + const gchar *hyphen_name; +} _ExtendedGDBusInterfaceInfo; + +typedef struct +{ + const _ExtendedGDBusPropertyInfo *info; + guint prop_id; + GValue orig_value; /* the value before the change */ +} ChangedProperty; + +static void +_changed_property_free (ChangedProperty *data) +{ + g_value_unset (&data->orig_value); + g_free (data); +} + +static gboolean +_g_strv_equal0 (gchar **a, gchar **b) +{ + gboolean ret = FALSE; + guint n; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + if (g_strv_length (a) != g_strv_length (b)) + goto out; + for (n = 0; a[n] != NULL; n++) + if (g_strcmp0 (a[n], b[n]) != 0) + goto out; + ret = TRUE; +out: + return ret; +} + +static gboolean +_g_variant_equal0 (GVariant *a, GVariant *b) +{ + gboolean ret = FALSE; + if (a == NULL && b == NULL) + { + ret = TRUE; + goto out; + } + if (a == NULL || b == NULL) + goto out; + ret = g_variant_equal (a, b); +out: + return ret; +} + +G_GNUC_UNUSED static gboolean +_g_value_equal (const GValue *a, const GValue *b) +{ + gboolean ret = FALSE; + g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b)); + switch (G_VALUE_TYPE (a)) + { + case G_TYPE_BOOLEAN: + ret = (g_value_get_boolean (a) == g_value_get_boolean (b)); + break; + case G_TYPE_UCHAR: + ret = (g_value_get_uchar (a) == g_value_get_uchar (b)); + break; + case G_TYPE_INT: + ret = (g_value_get_int (a) == g_value_get_int (b)); + break; + case G_TYPE_UINT: + ret = (g_value_get_uint (a) == g_value_get_uint (b)); + break; + case G_TYPE_INT64: + ret = (g_value_get_int64 (a) == g_value_get_int64 (b)); + break; + case G_TYPE_UINT64: + ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b)); + break; + case G_TYPE_DOUBLE: + { + /* Avoid -Wfloat-equal warnings by doing a direct bit compare */ + gdouble da = g_value_get_double (a); + gdouble db = g_value_get_double (b); + ret = memcmp (&da, &db, sizeof (gdouble)) == 0; + } + break; + case G_TYPE_STRING: + ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0); + break; + case G_TYPE_VARIANT: + ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b)); + break; + default: + if (G_VALUE_TYPE (a) == G_TYPE_STRV) + ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b)); + else + g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a))); + break; + } + return ret; +} + +/* ------------------------------------------------------------------------ + * Code for interface com.google.code.AccountsSSO.gSingleSignOn.Identity + * ------------------------------------------------------------------------ + */ + +/** + * SECTION:SsoIdentity + * @title: SsoIdentity + * @short_description: Generated C code for the com.google.code.AccountsSSO.gSingleSignOn.Identity D-Bus interface + * + * This section contains code for working with the com.google.code.AccountsSSO.gSingleSignOn.Identity D-Bus interface in C. + */ + +/* ---- Introspection data for com.google.code.AccountsSSO.gSingleSignOn.Identity ---- */ + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_request_credentials_update_IN_ARG_message = +{ + { + -1, + "message", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_request_credentials_update_IN_ARG_pointers[] = +{ + &_sso_identity_method_info_request_credentials_update_IN_ARG_message, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_request_credentials_update_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "u", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_request_credentials_update_OUT_ARG_pointers[] = +{ + &_sso_identity_method_info_request_credentials_update_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_identity_method_info_request_credentials_update = +{ + { + -1, + "requestCredentialsUpdate", + (GDBusArgInfo **) &_sso_identity_method_info_request_credentials_update_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_identity_method_info_request_credentials_update_OUT_ARG_pointers, + NULL + }, + "handle-request-credentials-update", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_get_info_OUT_ARG_identityInfo = +{ + { + -1, + "identityInfo", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_get_info_OUT_ARG_pointers[] = +{ + &_sso_identity_method_info_get_info_OUT_ARG_identityInfo, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_identity_method_info_get_info = +{ + { + -1, + "getInfo", + NULL, + (GDBusArgInfo **) &_sso_identity_method_info_get_info_OUT_ARG_pointers, + NULL + }, + "handle-get-info", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_get_auth_session_IN_ARG_method = +{ + { + -1, + "method", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_get_auth_session_IN_ARG_pointers[] = +{ + &_sso_identity_method_info_get_auth_session_IN_ARG_method, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_get_auth_session_OUT_ARG_objectPath = +{ + { + -1, + "objectPath", + "o", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_get_auth_session_OUT_ARG_pointers[] = +{ + &_sso_identity_method_info_get_auth_session_OUT_ARG_objectPath, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_identity_method_info_get_auth_session = +{ + { + -1, + "getAuthSession", + (GDBusArgInfo **) &_sso_identity_method_info_get_auth_session_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_identity_method_info_get_auth_session_OUT_ARG_pointers, + NULL + }, + "handle-get-auth-session", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_verify_user_IN_ARG_params = +{ + { + -1, + "params", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_verify_user_IN_ARG_pointers[] = +{ + &_sso_identity_method_info_verify_user_IN_ARG_params, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_verify_user_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "b", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_verify_user_OUT_ARG_pointers[] = +{ + &_sso_identity_method_info_verify_user_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_identity_method_info_verify_user = +{ + { + -1, + "verifyUser", + (GDBusArgInfo **) &_sso_identity_method_info_verify_user_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_identity_method_info_verify_user_OUT_ARG_pointers, + NULL + }, + "handle-verify-user", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_verify_secret_IN_ARG_secret = +{ + { + -1, + "secret", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_verify_secret_IN_ARG_pointers[] = +{ + &_sso_identity_method_info_verify_secret_IN_ARG_secret, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_verify_secret_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "b", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_verify_secret_OUT_ARG_pointers[] = +{ + &_sso_identity_method_info_verify_secret_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_identity_method_info_verify_secret = +{ + { + -1, + "verifySecret", + (GDBusArgInfo **) &_sso_identity_method_info_verify_secret_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_identity_method_info_verify_secret_OUT_ARG_pointers, + NULL + }, + "handle-verify-secret", + FALSE +}; + +static const _ExtendedGDBusMethodInfo _sso_identity_method_info_remove = +{ + { + -1, + "remove", + NULL, + NULL, + NULL + }, + "handle-remove", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_sign_out_OUT_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "b", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_sign_out_OUT_ARG_pointers[] = +{ + &_sso_identity_method_info_sign_out_OUT_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_identity_method_info_sign_out = +{ + { + -1, + "signOut", + NULL, + (GDBusArgInfo **) &_sso_identity_method_info_sign_out_OUT_ARG_pointers, + NULL + }, + "handle-sign-out", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_store_IN_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_store_IN_ARG_pointers[] = +{ + &_sso_identity_method_info_store_IN_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_store_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "u", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_store_OUT_ARG_pointers[] = +{ + &_sso_identity_method_info_store_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_identity_method_info_store = +{ + { + -1, + "store", + (GDBusArgInfo **) &_sso_identity_method_info_store_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_identity_method_info_store_OUT_ARG_pointers, + NULL + }, + "handle-store", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_add_reference_IN_ARG_reference = +{ + { + -1, + "reference", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_add_reference_IN_ARG_pointers[] = +{ + &_sso_identity_method_info_add_reference_IN_ARG_reference, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_add_reference_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_add_reference_OUT_ARG_pointers[] = +{ + &_sso_identity_method_info_add_reference_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_identity_method_info_add_reference = +{ + { + -1, + "addReference", + (GDBusArgInfo **) &_sso_identity_method_info_add_reference_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_identity_method_info_add_reference_OUT_ARG_pointers, + NULL + }, + "handle-add-reference", + FALSE +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_remove_reference_IN_ARG_reference = +{ + { + -1, + "reference", + "s", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_remove_reference_IN_ARG_pointers[] = +{ + &_sso_identity_method_info_remove_reference_IN_ARG_reference, + NULL +}; + +static const _ExtendedGDBusArgInfo _sso_identity_method_info_remove_reference_OUT_ARG_unnamed_arg1 = +{ + { + -1, + "unnamed_arg1", + "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_method_info_remove_reference_OUT_ARG_pointers[] = +{ + &_sso_identity_method_info_remove_reference_OUT_ARG_unnamed_arg1, + NULL +}; + +static const _ExtendedGDBusMethodInfo _sso_identity_method_info_remove_reference = +{ + { + -1, + "removeReference", + (GDBusArgInfo **) &_sso_identity_method_info_remove_reference_IN_ARG_pointers, + (GDBusArgInfo **) &_sso_identity_method_info_remove_reference_OUT_ARG_pointers, + NULL + }, + "handle-remove-reference", + FALSE +}; + +static const _ExtendedGDBusMethodInfo * const _sso_identity_method_info_pointers[] = +{ + &_sso_identity_method_info_request_credentials_update, + &_sso_identity_method_info_get_info, + &_sso_identity_method_info_get_auth_session, + &_sso_identity_method_info_verify_user, + &_sso_identity_method_info_verify_secret, + &_sso_identity_method_info_remove, + &_sso_identity_method_info_sign_out, + &_sso_identity_method_info_store, + &_sso_identity_method_info_add_reference, + &_sso_identity_method_info_remove_reference, + NULL +}; + +static const _ExtendedGDBusSignalInfo _sso_identity_signal_info_unregistered = +{ + { + -1, + "unregistered", + NULL, + NULL + }, + "unregistered" +}; + +static const _ExtendedGDBusArgInfo _sso_identity_signal_info_info_updated_ARG_unnamed_arg0 = +{ + { + -1, + "unnamed_arg0", + "i", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _sso_identity_signal_info_info_updated_ARG_pointers[] = +{ + &_sso_identity_signal_info_info_updated_ARG_unnamed_arg0, + NULL +}; + +static const _ExtendedGDBusSignalInfo _sso_identity_signal_info_info_updated = +{ + { + -1, + "infoUpdated", + (GDBusArgInfo **) &_sso_identity_signal_info_info_updated_ARG_pointers, + NULL + }, + "info-updated" +}; + +static const _ExtendedGDBusSignalInfo * const _sso_identity_signal_info_pointers[] = +{ + &_sso_identity_signal_info_unregistered, + &_sso_identity_signal_info_info_updated, + NULL +}; + +static const _ExtendedGDBusInterfaceInfo _sso_identity_interface_info = +{ + { + -1, + "com.google.code.AccountsSSO.gSingleSignOn.Identity", + (GDBusMethodInfo **) &_sso_identity_method_info_pointers, + (GDBusSignalInfo **) &_sso_identity_signal_info_pointers, + NULL, + NULL + }, + "sso-identity", +}; + + +/** + * sso_identity_interface_info: + * + * Gets a machine-readable description of the com.google.code.AccountsSSO.gSingleSignOn.Identity D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ +GDBusInterfaceInfo * +sso_identity_interface_info (void) +{ + return (GDBusInterfaceInfo *) &_sso_identity_interface_info; +} + +/** + * sso_identity_override_properties: + * @klass: The class structure for a #GObject-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #SsoIdentity interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ +guint +sso_identity_override_properties (GObjectClass *klass, guint property_id_begin) +{ + return property_id_begin - 1; +} + + + +/** + * SsoIdentity: + * + * Abstract interface type for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.Identity. + */ + +/** + * SsoIdentityIface: + * @parent_iface: The parent interface. + * @handle_add_reference: Handler for the #SsoIdentity::handle-add-reference signal. + * @handle_get_auth_session: Handler for the #SsoIdentity::handle-get-auth-session signal. + * @handle_get_info: Handler for the #SsoIdentity::handle-get-info signal. + * @handle_remove: Handler for the #SsoIdentity::handle-remove signal. + * @handle_remove_reference: Handler for the #SsoIdentity::handle-remove-reference signal. + * @handle_request_credentials_update: Handler for the #SsoIdentity::handle-request-credentials-update signal. + * @handle_sign_out: Handler for the #SsoIdentity::handle-sign-out signal. + * @handle_store: Handler for the #SsoIdentity::handle-store signal. + * @handle_verify_secret: Handler for the #SsoIdentity::handle-verify-secret signal. + * @handle_verify_user: Handler for the #SsoIdentity::handle-verify-user signal. + * @info_updated: Handler for the #SsoIdentity::info-updated signal. + * @unregistered: Handler for the #SsoIdentity::unregistered signal. + * + * Virtual table for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.Identity. + */ + +static void +sso_identity_default_init (SsoIdentityIface *iface) +{ + /* GObject signals for incoming D-Bus method calls: */ + /** + * SsoIdentity::handle-request-credentials-update: + * @object: A #SsoIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_message: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the requestCredentialsUpdate() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_identity_complete_request_credentials_update() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-request-credentials-update", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, handle_request_credentials_update), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * SsoIdentity::handle-get-info: + * @object: A #SsoIdentity. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the getInfo() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_identity_complete_get_info() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-info", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, handle_get_info), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * SsoIdentity::handle-get-auth-session: + * @object: A #SsoIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_method: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the getAuthSession() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_identity_complete_get_auth_session() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-get-auth-session", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, handle_get_auth_session), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * SsoIdentity::handle-verify-user: + * @object: A #SsoIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_params: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the verifyUser() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_identity_complete_verify_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-verify-user", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, handle_verify_user), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * SsoIdentity::handle-verify-secret: + * @object: A #SsoIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_secret: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the verifySecret() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_identity_complete_verify_secret() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-verify-secret", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, handle_verify_secret), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * SsoIdentity::handle-remove: + * @object: A #SsoIdentity. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the remove() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_identity_complete_remove() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-remove", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, handle_remove), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * SsoIdentity::handle-sign-out: + * @object: A #SsoIdentity. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the signOut() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_identity_complete_sign_out() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-sign-out", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, handle_sign_out), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 1, + G_TYPE_DBUS_METHOD_INVOCATION); + + /** + * SsoIdentity::handle-store: + * @object: A #SsoIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_unnamed_arg0: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the store() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_identity_complete_store() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-store", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, handle_store), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); + + /** + * SsoIdentity::handle-add-reference: + * @object: A #SsoIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_reference: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the addReference() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_identity_complete_add_reference() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-add-reference", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, handle_add_reference), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /** + * SsoIdentity::handle-remove-reference: + * @object: A #SsoIdentity. + * @invocation: A #GDBusMethodInvocation. + * @arg_reference: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the removeReference() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call sso_identity_complete_remove_reference() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + g_signal_new ("handle-remove-reference", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, handle_remove_reference), + g_signal_accumulator_true_handled, + NULL, + g_cclosure_marshal_generic, + G_TYPE_BOOLEAN, + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + + /* GObject signals for received D-Bus signals: */ + /** + * SsoIdentity::unregistered: + * @object: A #SsoIdentity. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "unregistered" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("unregistered", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, unregistered), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 0); + + /** + * SsoIdentity::info-updated: + * @object: A #SsoIdentity. + * @arg_unnamed_arg0: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "infoUpdated" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + g_signal_new ("info-updated", + G_TYPE_FROM_INTERFACE (iface), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (SsoIdentityIface, info_updated), + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 1, G_TYPE_INT); + +} + +typedef SsoIdentityIface SsoIdentityInterface; +G_DEFINE_INTERFACE (SsoIdentity, sso_identity, G_TYPE_OBJECT); + +/** + * sso_identity_emit_unregistered: + * @object: A #SsoIdentity. + * + * Emits the "unregistered" D-Bus signal. + */ +void +sso_identity_emit_unregistered ( + SsoIdentity *object) +{ + g_signal_emit_by_name (object, "unregistered"); +} + +/** + * sso_identity_emit_info_updated: + * @object: A #SsoIdentity. + * @arg_unnamed_arg0: Argument to pass with the signal. + * + * Emits the "infoUpdated" D-Bus signal. + */ +void +sso_identity_emit_info_updated ( + SsoIdentity *object, + gint arg_unnamed_arg0) +{ + g_signal_emit_by_name (object, "info-updated", arg_unnamed_arg0); +} + +/** + * sso_identity_call_request_credentials_update: + * @proxy: A #SsoIdentityProxy. + * @arg_message: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the requestCredentialsUpdate() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_call_request_credentials_update_finish() to get the result of the operation. + * + * See sso_identity_call_request_credentials_update_sync() for the synchronous, blocking version of this method. + */ +void +sso_identity_call_request_credentials_update ( + SsoIdentity *proxy, + const gchar *arg_message, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "requestCredentialsUpdate", + g_variant_new ("(s)", + arg_message), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_identity_call_request_credentials_update_finish: + * @proxy: A #SsoIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_call_request_credentials_update(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_identity_call_request_credentials_update(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_request_credentials_update_finish ( + SsoIdentity *proxy, + guint *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_request_credentials_update_sync: + * @proxy: A #SsoIdentityProxy. + * @arg_message: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the requestCredentialsUpdate() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_identity_call_request_credentials_update() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_request_credentials_update_sync ( + SsoIdentity *proxy, + const gchar *arg_message, + guint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "requestCredentialsUpdate", + g_variant_new ("(s)", + arg_message), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_get_info: + * @proxy: A #SsoIdentityProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the getInfo() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_call_get_info_finish() to get the result of the operation. + * + * See sso_identity_call_get_info_sync() for the synchronous, blocking version of this method. + */ +void +sso_identity_call_get_info ( + SsoIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "getInfo", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_identity_call_get_info_finish: + * @proxy: A #SsoIdentityProxy. + * @out_identityInfo: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_call_get_info(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_identity_call_get_info(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_get_info_finish ( + SsoIdentity *proxy, + GVariant **out_identityInfo, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_identityInfo); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_get_info_sync: + * @proxy: A #SsoIdentityProxy. + * @out_identityInfo: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the getInfo() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_identity_call_get_info() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_get_info_sync ( + SsoIdentity *proxy, + GVariant **out_identityInfo, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "getInfo", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(@a{sv})", + out_identityInfo); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_get_auth_session: + * @proxy: A #SsoIdentityProxy. + * @arg_method: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the getAuthSession() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_call_get_auth_session_finish() to get the result of the operation. + * + * See sso_identity_call_get_auth_session_sync() for the synchronous, blocking version of this method. + */ +void +sso_identity_call_get_auth_session ( + SsoIdentity *proxy, + const gchar *arg_method, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "getAuthSession", + g_variant_new ("(s)", + arg_method), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_identity_call_get_auth_session_finish: + * @proxy: A #SsoIdentityProxy. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_call_get_auth_session(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_identity_call_get_auth_session(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_get_auth_session_finish ( + SsoIdentity *proxy, + gchar **out_objectPath, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_objectPath); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_get_auth_session_sync: + * @proxy: A #SsoIdentityProxy. + * @arg_method: Argument to pass with the method invocation. + * @out_objectPath: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the getAuthSession() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_identity_call_get_auth_session() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_get_auth_session_sync ( + SsoIdentity *proxy, + const gchar *arg_method, + gchar **out_objectPath, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "getAuthSession", + g_variant_new ("(s)", + arg_method), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(o)", + out_objectPath); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_verify_user: + * @proxy: A #SsoIdentityProxy. + * @arg_params: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the verifyUser() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_call_verify_user_finish() to get the result of the operation. + * + * See sso_identity_call_verify_user_sync() for the synchronous, blocking version of this method. + */ +void +sso_identity_call_verify_user ( + SsoIdentity *proxy, + GVariant *arg_params, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "verifyUser", + g_variant_new ("(@a{sv})", + arg_params), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_identity_call_verify_user_finish: + * @proxy: A #SsoIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_call_verify_user(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_identity_call_verify_user(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_verify_user_finish ( + SsoIdentity *proxy, + gboolean *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_verify_user_sync: + * @proxy: A #SsoIdentityProxy. + * @arg_params: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the verifyUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_identity_call_verify_user() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_verify_user_sync ( + SsoIdentity *proxy, + GVariant *arg_params, + gboolean *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "verifyUser", + g_variant_new ("(@a{sv})", + arg_params), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_verify_secret: + * @proxy: A #SsoIdentityProxy. + * @arg_secret: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the verifySecret() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_call_verify_secret_finish() to get the result of the operation. + * + * See sso_identity_call_verify_secret_sync() for the synchronous, blocking version of this method. + */ +void +sso_identity_call_verify_secret ( + SsoIdentity *proxy, + const gchar *arg_secret, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "verifySecret", + g_variant_new ("(s)", + arg_secret), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_identity_call_verify_secret_finish: + * @proxy: A #SsoIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_call_verify_secret(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_identity_call_verify_secret(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_verify_secret_finish ( + SsoIdentity *proxy, + gboolean *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_verify_secret_sync: + * @proxy: A #SsoIdentityProxy. + * @arg_secret: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the verifySecret() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_identity_call_verify_secret() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_verify_secret_sync ( + SsoIdentity *proxy, + const gchar *arg_secret, + gboolean *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "verifySecret", + g_variant_new ("(s)", + arg_secret), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_remove: + * @proxy: A #SsoIdentityProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the remove() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_call_remove_finish() to get the result of the operation. + * + * See sso_identity_call_remove_sync() for the synchronous, blocking version of this method. + */ +void +sso_identity_call_remove ( + SsoIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "remove", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_identity_call_remove_finish: + * @proxy: A #SsoIdentityProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_call_remove(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_identity_call_remove(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_remove_finish ( + SsoIdentity *proxy, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_remove_sync: + * @proxy: A #SsoIdentityProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the remove() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_identity_call_remove() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_remove_sync ( + SsoIdentity *proxy, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "remove", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "()"); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_sign_out: + * @proxy: A #SsoIdentityProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the signOut() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_call_sign_out_finish() to get the result of the operation. + * + * See sso_identity_call_sign_out_sync() for the synchronous, blocking version of this method. + */ +void +sso_identity_call_sign_out ( + SsoIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "signOut", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_identity_call_sign_out_finish: + * @proxy: A #SsoIdentityProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_call_sign_out(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_identity_call_sign_out(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_sign_out_finish ( + SsoIdentity *proxy, + gboolean *out_unnamed_arg0, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_sign_out_sync: + * @proxy: A #SsoIdentityProxy. + * @out_unnamed_arg0: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the signOut() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_identity_call_sign_out() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_sign_out_sync ( + SsoIdentity *proxy, + gboolean *out_unnamed_arg0, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "signOut", + g_variant_new ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(b)", + out_unnamed_arg0); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_store: + * @proxy: A #SsoIdentityProxy. + * @arg_unnamed_arg0: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the store() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_call_store_finish() to get the result of the operation. + * + * See sso_identity_call_store_sync() for the synchronous, blocking version of this method. + */ +void +sso_identity_call_store ( + SsoIdentity *proxy, + GVariant *arg_unnamed_arg0, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "store", + g_variant_new ("(@a{sv})", + arg_unnamed_arg0), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_identity_call_store_finish: + * @proxy: A #SsoIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_call_store(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_identity_call_store(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_store_finish ( + SsoIdentity *proxy, + guint *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_store_sync: + * @proxy: A #SsoIdentityProxy. + * @arg_unnamed_arg0: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the store() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_identity_call_store() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_store_sync ( + SsoIdentity *proxy, + GVariant *arg_unnamed_arg0, + guint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "store", + g_variant_new ("(@a{sv})", + arg_unnamed_arg0), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(u)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_add_reference: + * @proxy: A #SsoIdentityProxy. + * @arg_reference: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the addReference() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_call_add_reference_finish() to get the result of the operation. + * + * See sso_identity_call_add_reference_sync() for the synchronous, blocking version of this method. + */ +void +sso_identity_call_add_reference ( + SsoIdentity *proxy, + const gchar *arg_reference, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "addReference", + g_variant_new ("(s)", + arg_reference), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_identity_call_add_reference_finish: + * @proxy: A #SsoIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_call_add_reference(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_identity_call_add_reference(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_add_reference_finish ( + SsoIdentity *proxy, + gint *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(i)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_add_reference_sync: + * @proxy: A #SsoIdentityProxy. + * @arg_reference: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the addReference() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_identity_call_add_reference() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_add_reference_sync ( + SsoIdentity *proxy, + const gchar *arg_reference, + gint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "addReference", + g_variant_new ("(s)", + arg_reference), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(i)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_remove_reference: + * @proxy: A #SsoIdentityProxy. + * @arg_reference: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the removeReference() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_call_remove_reference_finish() to get the result of the operation. + * + * See sso_identity_call_remove_reference_sync() for the synchronous, blocking version of this method. + */ +void +sso_identity_call_remove_reference ( + SsoIdentity *proxy, + const gchar *arg_reference, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_dbus_proxy_call (G_DBUS_PROXY (proxy), + "removeReference", + g_variant_new ("(s)", + arg_reference), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + callback, + user_data); +} + +/** + * sso_identity_call_remove_reference_finish: + * @proxy: A #SsoIdentityProxy. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_call_remove_reference(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with sso_identity_call_remove_reference(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_remove_reference_finish ( + SsoIdentity *proxy, + gint *out_unnamed_arg1, + GAsyncResult *res, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(i)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_call_remove_reference_sync: + * @proxy: A #SsoIdentityProxy. + * @arg_reference: Argument to pass with the method invocation. + * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the removeReference() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See sso_identity_call_remove_reference() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ +gboolean +sso_identity_call_remove_reference_sync ( + SsoIdentity *proxy, + const gchar *arg_reference, + gint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error) +{ + GVariant *_ret; + _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), + "removeReference", + g_variant_new ("(s)", + arg_reference), + G_DBUS_CALL_FLAGS_NONE, + -1, + cancellable, + error); + if (_ret == NULL) + goto _out; + g_variant_get (_ret, + "(i)", + out_unnamed_arg1); + g_variant_unref (_ret); +_out: + return _ret != NULL; +} + +/** + * sso_identity_complete_request_credentials_update: + * @object: A #SsoIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the requestCredentialsUpdate() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_identity_complete_request_credentials_update ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + guint unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(u)", + unnamed_arg1)); +} + +/** + * sso_identity_complete_get_info: + * @object: A #SsoIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @identityInfo: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the getInfo() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_identity_complete_get_info ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + GVariant *identityInfo) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(@a{sv})", + identityInfo)); +} + +/** + * sso_identity_complete_get_auth_session: + * @object: A #SsoIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @objectPath: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the getAuthSession() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_identity_complete_get_auth_session ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(o)", + objectPath)); +} + +/** + * sso_identity_complete_verify_user: + * @object: A #SsoIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the verifyUser() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_identity_complete_verify_user ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + unnamed_arg1)); +} + +/** + * sso_identity_complete_verify_secret: + * @object: A #SsoIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the verifySecret() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_identity_complete_verify_secret ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + unnamed_arg1)); +} + +/** + * sso_identity_complete_remove: + * @object: A #SsoIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the remove() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_identity_complete_remove ( + SsoIdentity *object, + GDBusMethodInvocation *invocation) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("()")); +} + +/** + * sso_identity_complete_sign_out: + * @object: A #SsoIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg0: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the signOut() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_identity_complete_sign_out ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg0) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(b)", + unnamed_arg0)); +} + +/** + * sso_identity_complete_store: + * @object: A #SsoIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the store() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_identity_complete_store ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + guint unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(u)", + unnamed_arg1)); +} + +/** + * sso_identity_complete_add_reference: + * @object: A #SsoIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the addReference() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_identity_complete_add_reference ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + gint unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(i)", + unnamed_arg1)); +} + +/** + * sso_identity_complete_remove_reference: + * @object: A #SsoIdentity. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unnamed_arg1: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the removeReference() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ +void +sso_identity_complete_remove_reference ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + gint unnamed_arg1) +{ + g_dbus_method_invocation_return_value (invocation, + g_variant_new ("(i)", + unnamed_arg1)); +} + +/* ------------------------------------------------------------------------ */ + +/** + * SsoIdentityProxy: + * + * The #SsoIdentityProxy structure contains only private data and should only be accessed using the provided API. + */ + +/** + * SsoIdentityProxyClass: + * @parent_class: The parent class. + * + * Class structure for #SsoIdentityProxy. + */ + +struct _SsoIdentityProxyPrivate +{ + GData *qdata; +}; + +static void sso_identity_proxy_iface_init (SsoIdentityIface *iface); + +G_DEFINE_TYPE_WITH_CODE (SsoIdentityProxy, sso_identity_proxy, G_TYPE_DBUS_PROXY, + G_IMPLEMENT_INTERFACE (TYPE_SSO_IDENTITY, sso_identity_proxy_iface_init)); + +static void +sso_identity_proxy_finalize (GObject *object) +{ + SsoIdentityProxy *proxy = SSO_IDENTITY_PROXY (object); + g_datalist_clear (&proxy->priv->qdata); + G_OBJECT_CLASS (sso_identity_proxy_parent_class)->finalize (object); +} + +static void +sso_identity_proxy_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ +} + +static void +sso_identity_proxy_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ +} + +static void +sso_identity_proxy_g_signal (GDBusProxy *proxy, + const gchar *sender_name, + const gchar *signal_name, + GVariant *parameters) +{ + _ExtendedGDBusSignalInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint n; + guint signal_id; + info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_sso_identity_interface_info, signal_name); + if (info == NULL) + return; + num_params = g_variant_n_children (parameters); + paramv = g_new0 (GValue, num_params + 1); + g_value_init (¶mv[0], TYPE_SSO_IDENTITY); + g_value_set_object (¶mv[0], proxy); + g_variant_iter_init (&iter, parameters); + n = 1; + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_SSO_IDENTITY); + g_signal_emitv (paramv, signal_id, 0, NULL); + for (n = 0; n < num_params + 1; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static void +sso_identity_proxy_g_properties_changed (GDBusProxy *_proxy, + GVariant *changed_properties, + const gchar *const *invalidated_properties) +{ + SsoIdentityProxy *proxy = SSO_IDENTITY_PROXY (_proxy); + guint n; + const gchar *key; + GVariantIter *iter; + _ExtendedGDBusPropertyInfo *info; + g_variant_get (changed_properties, "a{sv}", &iter); + while (g_variant_iter_next (iter, "{&sv}", &key, NULL)) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_identity_interface_info, key); + g_datalist_remove_data (&proxy->priv->qdata, key); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } + g_variant_iter_free (iter); + for (n = 0; invalidated_properties[n] != NULL; n++) + { + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_identity_interface_info, invalidated_properties[n]); + g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]); + if (info != NULL) + g_object_notify (G_OBJECT (proxy), info->hyphen_name); + } +} + +static void +sso_identity_proxy_init (SsoIdentityProxy *proxy) +{ + proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_SSO_IDENTITY_PROXY, SsoIdentityProxyPrivate); + g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), sso_identity_interface_info ()); +} + +static void +sso_identity_proxy_class_init (SsoIdentityProxyClass *klass) +{ + GObjectClass *gobject_class; + GDBusProxyClass *proxy_class; + + g_type_class_add_private (klass, sizeof (SsoIdentityProxyPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = sso_identity_proxy_finalize; + gobject_class->get_property = sso_identity_proxy_get_property; + gobject_class->set_property = sso_identity_proxy_set_property; + + proxy_class = G_DBUS_PROXY_CLASS (klass); + proxy_class->g_signal = sso_identity_proxy_g_signal; + proxy_class->g_properties_changed = sso_identity_proxy_g_properties_changed; + +} + +static void +sso_identity_proxy_iface_init (SsoIdentityIface *iface) +{ +} + +/** + * sso_identity_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.Identity. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_proxy_new_finish() to get the result of the operation. + * + * See sso_identity_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ +void +sso_identity_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_SSO_IDENTITY_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.Identity", NULL); +} + +/** + * sso_identity_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with sso_identity_proxy_new(). + * + * Returns: (transfer full) (type SsoIdentityProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoIdentity * +sso_identity_proxy_new_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return SSO_IDENTITY (ret); + else + return NULL; +} + +/** + * sso_identity_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.Identity. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See sso_identity_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type SsoIdentityProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoIdentity * +sso_identity_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_SSO_IDENTITY_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.Identity", NULL); + if (ret != NULL) + return SSO_IDENTITY (ret); + else + return NULL; +} + + +/** + * sso_identity_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like sso_identity_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call sso_identity_proxy_new_for_bus_finish() to get the result of the operation. + * + * See sso_identity_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ +void +sso_identity_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + g_async_initable_new_async (TYPE_SSO_IDENTITY_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.Identity", NULL); +} + +/** + * sso_identity_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to sso_identity_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with sso_identity_proxy_new_for_bus(). + * + * Returns: (transfer full) (type SsoIdentityProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoIdentity * +sso_identity_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error) +{ + GObject *ret; + GObject *source_object; + source_object = g_async_result_get_source_object (res); + ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error); + g_object_unref (source_object); + if (ret != NULL) + return SSO_IDENTITY (ret); + else + return NULL; +} + +/** + * sso_identity_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like sso_identity_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See sso_identity_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type SsoIdentityProxy): The constructed proxy object or %NULL if @error is set. + */ +SsoIdentity * +sso_identity_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error) +{ + GInitable *ret; + ret = g_initable_new (TYPE_SSO_IDENTITY_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "com.google.code.AccountsSSO.gSingleSignOn.Identity", NULL); + if (ret != NULL) + return SSO_IDENTITY (ret); + else + return NULL; +} + + +/* ------------------------------------------------------------------------ */ + +/** + * SsoIdentitySkeleton: + * + * The #SsoIdentitySkeleton structure contains only private data and should only be accessed using the provided API. + */ + +/** + * SsoIdentitySkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #SsoIdentitySkeleton. + */ + +struct _SsoIdentitySkeletonPrivate +{ + GValue *properties; + GList *changed_properties; + GSource *changed_properties_idle_source; + GMainContext *context; + GMutex lock; +}; + +static void +_sso_identity_skeleton_handle_method_call ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + SsoIdentitySkeleton *skeleton = SSO_IDENTITY_SKELETON (user_data); + _ExtendedGDBusMethodInfo *info; + GVariantIter iter; + GVariant *child; + GValue *paramv; + guint num_params; + guint num_extra; + guint n; + guint signal_id; + GValue return_value = G_VALUE_INIT; + info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); + g_assert (info != NULL); + num_params = g_variant_n_children (parameters); + num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra); + n = 0; + g_value_init (¶mv[n], TYPE_SSO_IDENTITY); + g_value_set_object (¶mv[n++], skeleton); + g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION); + g_value_set_object (¶mv[n++], invocation); + if (info->pass_fdlist) + { +#ifdef G_OS_UNIX + g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST); + g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation))); +#else + g_assert_not_reached (); +#endif + } + g_variant_iter_init (&iter, parameters); + while ((child = g_variant_iter_next_value (&iter)) != NULL) + { + _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra]; + if (arg_info->use_gvariant) + { + g_value_init (¶mv[n], G_TYPE_VARIANT); + g_value_set_variant (¶mv[n], child); + n++; + } + else + g_dbus_gvariant_to_gvalue (child, ¶mv[n++]); + g_variant_unref (child); + } + signal_id = g_signal_lookup (info->signal_name, TYPE_SSO_IDENTITY); + g_value_init (&return_value, G_TYPE_BOOLEAN); + g_signal_emitv (paramv, signal_id, 0, &return_value); + if (!g_value_get_boolean (&return_value)) + g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name); + g_value_unset (&return_value); + for (n = 0; n < num_params + num_extra; n++) + g_value_unset (¶mv[n]); + g_free (paramv); +} + +static GVariant * +_sso_identity_skeleton_handle_get_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GError **error, + gpointer user_data) +{ + SsoIdentitySkeleton *skeleton = SSO_IDENTITY_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + GVariant *ret; + ret = NULL; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_identity_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + g_value_init (&value, pspec->value_type); + g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value); + ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature)); + g_value_unset (&value); + } + return ret; +} + +static gboolean +_sso_identity_skeleton_handle_set_property ( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *property_name, + GVariant *variant, + GError **error, + gpointer user_data) +{ + SsoIdentitySkeleton *skeleton = SSO_IDENTITY_SKELETON (user_data); + GValue value = G_VALUE_INIT; + GParamSpec *pspec; + _ExtendedGDBusPropertyInfo *info; + gboolean ret; + ret = FALSE; + info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_sso_identity_interface_info, property_name); + g_assert (info != NULL); + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name); + if (pspec == NULL) + { + g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name); + } + else + { + if (info->use_gvariant) + g_value_set_variant (&value, variant); + else + g_dbus_gvariant_to_gvalue (variant, &value); + g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value); + g_value_unset (&value); + ret = TRUE; + } + return ret; +} + +static const GDBusInterfaceVTable _sso_identity_skeleton_vtable = +{ + _sso_identity_skeleton_handle_method_call, + _sso_identity_skeleton_handle_get_property, + _sso_identity_skeleton_handle_set_property +}; + +static GDBusInterfaceInfo * +sso_identity_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton) +{ + return sso_identity_interface_info (); +} + +static GDBusInterfaceVTable * +sso_identity_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton) +{ + return (GDBusInterfaceVTable *) &_sso_identity_skeleton_vtable; +} + +static GVariant * +sso_identity_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton) +{ + SsoIdentitySkeleton *skeleton = SSO_IDENTITY_SKELETON (_skeleton); + + GVariantBuilder builder; + guint n; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + if (_sso_identity_interface_info.parent_struct.properties == NULL) + goto out; + for (n = 0; _sso_identity_interface_info.parent_struct.properties[n] != NULL; n++) + { + GDBusPropertyInfo *info = _sso_identity_interface_info.parent_struct.properties[n]; + if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE) + { + GVariant *value; + value = _sso_identity_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.Identity", info->name, NULL, skeleton); + if (value != NULL) + { + g_variant_take_ref (value); + g_variant_builder_add (&builder, "{sv}", info->name, value); + g_variant_unref (value); + } + } + } +out: + return g_variant_builder_end (&builder); +} + +static void +sso_identity_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton) +{ +} + +static void +_sso_identity_on_signal_unregistered ( + SsoIdentity *object) +{ + SsoIdentitySkeleton *skeleton = SSO_IDENTITY_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("()")); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.Identity", "unregistered", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void +_sso_identity_on_signal_info_updated ( + SsoIdentity *object, + gint arg_unnamed_arg0) +{ + SsoIdentitySkeleton *skeleton = SSO_IDENTITY_SKELETON (object); + + GList *connections, *l; + GVariant *signal_variant; + connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton)); + + signal_variant = g_variant_ref_sink (g_variant_new ("(i)", + arg_unnamed_arg0)); + for (l = connections; l != NULL; l = l->next) + { + GDBusConnection *connection = l->data; + g_dbus_connection_emit_signal (connection, + NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "com.google.code.AccountsSSO.gSingleSignOn.Identity", "infoUpdated", + signal_variant, NULL); + } + g_variant_unref (signal_variant); + g_list_free_full (connections, g_object_unref); +} + +static void sso_identity_skeleton_iface_init (SsoIdentityIface *iface); +G_DEFINE_TYPE_WITH_CODE (SsoIdentitySkeleton, sso_identity_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON, + G_IMPLEMENT_INTERFACE (TYPE_SSO_IDENTITY, sso_identity_skeleton_iface_init)); + +static void +sso_identity_skeleton_finalize (GObject *object) +{ + SsoIdentitySkeleton *skeleton = SSO_IDENTITY_SKELETON (object); + g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free); + if (skeleton->priv->changed_properties_idle_source != NULL) + g_source_destroy (skeleton->priv->changed_properties_idle_source); + g_main_context_unref (skeleton->priv->context); + g_mutex_clear (&skeleton->priv->lock); + G_OBJECT_CLASS (sso_identity_skeleton_parent_class)->finalize (object); +} + +static void +sso_identity_skeleton_init (SsoIdentitySkeleton *skeleton) +{ + skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_SSO_IDENTITY_SKELETON, SsoIdentitySkeletonPrivate); + g_mutex_init (&skeleton->priv->lock); + skeleton->priv->context = g_main_context_ref_thread_default (); +} + +static void +sso_identity_skeleton_class_init (SsoIdentitySkeletonClass *klass) +{ + GObjectClass *gobject_class; + GDBusInterfaceSkeletonClass *skeleton_class; + + g_type_class_add_private (klass, sizeof (SsoIdentitySkeletonPrivate)); + + gobject_class = G_OBJECT_CLASS (klass); + gobject_class->finalize = sso_identity_skeleton_finalize; + + skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass); + skeleton_class->get_info = sso_identity_skeleton_dbus_interface_get_info; + skeleton_class->get_properties = sso_identity_skeleton_dbus_interface_get_properties; + skeleton_class->flush = sso_identity_skeleton_dbus_interface_flush; + skeleton_class->get_vtable = sso_identity_skeleton_dbus_interface_get_vtable; +} + +static void +sso_identity_skeleton_iface_init (SsoIdentityIface *iface) +{ + iface->unregistered = _sso_identity_on_signal_unregistered; + iface->info_updated = _sso_identity_on_signal_info_updated; +} + +/** + * sso_identity_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface com.google.code.AccountsSSO.gSingleSignOn.Identity. + * + * Returns: (transfer full) (type SsoIdentitySkeleton): The skeleton object. + */ +SsoIdentity * +sso_identity_skeleton_new (void) +{ + return SSO_IDENTITY (g_object_new (TYPE_SSO_IDENTITY_SKELETON, NULL)); +} + diff --git a/libgsignon-glib/sso-identity-gen.h b/libgsignon-glib/sso-identity-gen.h new file mode 100644 index 0000000..7aa87ee --- /dev/null +++ b/libgsignon-glib/sso-identity-gen.h @@ -0,0 +1,449 @@ +/* + * Generated by gdbus-codegen 2.32.4. DO NOT EDIT. + * + * The license of this code is the same as for the source it was derived from. + */ + +#ifndef __SSO_IDENTITY_GEN_H__ +#define __SSO_IDENTITY_GEN_H__ + +#include + +G_BEGIN_DECLS + + +/* ------------------------------------------------------------------------ */ +/* Declarations for com.google.code.AccountsSSO.gSingleSignOn.Identity */ + +#define TYPE_SSO_IDENTITY (sso_identity_get_type ()) +#define SSO_IDENTITY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SSO_IDENTITY, SsoIdentity)) +#define IS_SSO_IDENTITY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SSO_IDENTITY)) +#define SSO_IDENTITY_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_SSO_IDENTITY, SsoIdentityIface)) + +struct _SsoIdentity; +typedef struct _SsoIdentity SsoIdentity; +typedef struct _SsoIdentityIface SsoIdentityIface; + +struct _SsoIdentityIface +{ + GTypeInterface parent_iface; + + + gboolean (*handle_add_reference) ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *arg_reference); + + gboolean (*handle_get_auth_session) ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *arg_method); + + gboolean (*handle_get_info) ( + SsoIdentity *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_remove) ( + SsoIdentity *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_remove_reference) ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *arg_reference); + + gboolean (*handle_request_credentials_update) ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *arg_message); + + gboolean (*handle_sign_out) ( + SsoIdentity *object, + GDBusMethodInvocation *invocation); + + gboolean (*handle_store) ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + GVariant *arg_unnamed_arg0); + + gboolean (*handle_verify_secret) ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *arg_secret); + + gboolean (*handle_verify_user) ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + GVariant *arg_params); + + void (*info_updated) ( + SsoIdentity *object, + gint arg_unnamed_arg0); + + void (*unregistered) ( + SsoIdentity *object); + +}; + +GType sso_identity_get_type (void) G_GNUC_CONST; + +GDBusInterfaceInfo *sso_identity_interface_info (void); +guint sso_identity_override_properties (GObjectClass *klass, guint property_id_begin); + + +/* D-Bus method call completion functions: */ +void sso_identity_complete_request_credentials_update ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + guint unnamed_arg1); + +void sso_identity_complete_get_info ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + GVariant *identityInfo); + +void sso_identity_complete_get_auth_session ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + const gchar *objectPath); + +void sso_identity_complete_verify_user ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg1); + +void sso_identity_complete_verify_secret ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg1); + +void sso_identity_complete_remove ( + SsoIdentity *object, + GDBusMethodInvocation *invocation); + +void sso_identity_complete_sign_out ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + gboolean unnamed_arg0); + +void sso_identity_complete_store ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + guint unnamed_arg1); + +void sso_identity_complete_add_reference ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + gint unnamed_arg1); + +void sso_identity_complete_remove_reference ( + SsoIdentity *object, + GDBusMethodInvocation *invocation, + gint unnamed_arg1); + + + +/* D-Bus signal emissions functions: */ +void sso_identity_emit_unregistered ( + SsoIdentity *object); + +void sso_identity_emit_info_updated ( + SsoIdentity *object, + gint arg_unnamed_arg0); + + + +/* D-Bus method calls: */ +void sso_identity_call_request_credentials_update ( + SsoIdentity *proxy, + const gchar *arg_message, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_identity_call_request_credentials_update_finish ( + SsoIdentity *proxy, + guint *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean sso_identity_call_request_credentials_update_sync ( + SsoIdentity *proxy, + const gchar *arg_message, + guint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void sso_identity_call_get_info ( + SsoIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_identity_call_get_info_finish ( + SsoIdentity *proxy, + GVariant **out_identityInfo, + GAsyncResult *res, + GError **error); + +gboolean sso_identity_call_get_info_sync ( + SsoIdentity *proxy, + GVariant **out_identityInfo, + GCancellable *cancellable, + GError **error); + +void sso_identity_call_get_auth_session ( + SsoIdentity *proxy, + const gchar *arg_method, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_identity_call_get_auth_session_finish ( + SsoIdentity *proxy, + gchar **out_objectPath, + GAsyncResult *res, + GError **error); + +gboolean sso_identity_call_get_auth_session_sync ( + SsoIdentity *proxy, + const gchar *arg_method, + gchar **out_objectPath, + GCancellable *cancellable, + GError **error); + +void sso_identity_call_verify_user ( + SsoIdentity *proxy, + GVariant *arg_params, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_identity_call_verify_user_finish ( + SsoIdentity *proxy, + gboolean *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean sso_identity_call_verify_user_sync ( + SsoIdentity *proxy, + GVariant *arg_params, + gboolean *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void sso_identity_call_verify_secret ( + SsoIdentity *proxy, + const gchar *arg_secret, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_identity_call_verify_secret_finish ( + SsoIdentity *proxy, + gboolean *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean sso_identity_call_verify_secret_sync ( + SsoIdentity *proxy, + const gchar *arg_secret, + gboolean *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void sso_identity_call_remove ( + SsoIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_identity_call_remove_finish ( + SsoIdentity *proxy, + GAsyncResult *res, + GError **error); + +gboolean sso_identity_call_remove_sync ( + SsoIdentity *proxy, + GCancellable *cancellable, + GError **error); + +void sso_identity_call_sign_out ( + SsoIdentity *proxy, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_identity_call_sign_out_finish ( + SsoIdentity *proxy, + gboolean *out_unnamed_arg0, + GAsyncResult *res, + GError **error); + +gboolean sso_identity_call_sign_out_sync ( + SsoIdentity *proxy, + gboolean *out_unnamed_arg0, + GCancellable *cancellable, + GError **error); + +void sso_identity_call_store ( + SsoIdentity *proxy, + GVariant *arg_unnamed_arg0, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_identity_call_store_finish ( + SsoIdentity *proxy, + guint *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean sso_identity_call_store_sync ( + SsoIdentity *proxy, + GVariant *arg_unnamed_arg0, + guint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void sso_identity_call_add_reference ( + SsoIdentity *proxy, + const gchar *arg_reference, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_identity_call_add_reference_finish ( + SsoIdentity *proxy, + gint *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean sso_identity_call_add_reference_sync ( + SsoIdentity *proxy, + const gchar *arg_reference, + gint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + +void sso_identity_call_remove_reference ( + SsoIdentity *proxy, + const gchar *arg_reference, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean sso_identity_call_remove_reference_finish ( + SsoIdentity *proxy, + gint *out_unnamed_arg1, + GAsyncResult *res, + GError **error); + +gboolean sso_identity_call_remove_reference_sync ( + SsoIdentity *proxy, + const gchar *arg_reference, + gint *out_unnamed_arg1, + GCancellable *cancellable, + GError **error); + + + +/* ---- */ + +#define TYPE_SSO_IDENTITY_PROXY (sso_identity_proxy_get_type ()) +#define SSO_IDENTITY_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SSO_IDENTITY_PROXY, SsoIdentityProxy)) +#define SSO_IDENTITY_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SSO_IDENTITY_PROXY, SsoIdentityProxyClass)) +#define SSO_IDENTITY_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SSO_IDENTITY_PROXY, SsoIdentityProxyClass)) +#define IS_SSO_IDENTITY_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SSO_IDENTITY_PROXY)) +#define IS_SSO_IDENTITY_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SSO_IDENTITY_PROXY)) + +typedef struct _SsoIdentityProxy SsoIdentityProxy; +typedef struct _SsoIdentityProxyClass SsoIdentityProxyClass; +typedef struct _SsoIdentityProxyPrivate SsoIdentityProxyPrivate; + +struct _SsoIdentityProxy +{ + /*< private >*/ + GDBusProxy parent_instance; + SsoIdentityProxyPrivate *priv; +}; + +struct _SsoIdentityProxyClass +{ + GDBusProxyClass parent_class; +}; + +GType sso_identity_proxy_get_type (void) G_GNUC_CONST; + +void sso_identity_proxy_new ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +SsoIdentity *sso_identity_proxy_new_finish ( + GAsyncResult *res, + GError **error); +SsoIdentity *sso_identity_proxy_new_sync ( + GDBusConnection *connection, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + +void sso_identity_proxy_new_for_bus ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +SsoIdentity *sso_identity_proxy_new_for_bus_finish ( + GAsyncResult *res, + GError **error); +SsoIdentity *sso_identity_proxy_new_for_bus_sync ( + GBusType bus_type, + GDBusProxyFlags flags, + const gchar *name, + const gchar *object_path, + GCancellable *cancellable, + GError **error); + + +/* ---- */ + +#define TYPE_SSO_IDENTITY_SKELETON (sso_identity_skeleton_get_type ()) +#define SSO_IDENTITY_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_SSO_IDENTITY_SKELETON, SsoIdentitySkeleton)) +#define SSO_IDENTITY_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_SSO_IDENTITY_SKELETON, SsoIdentitySkeletonClass)) +#define SSO_IDENTITY_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_SSO_IDENTITY_SKELETON, SsoIdentitySkeletonClass)) +#define IS_SSO_IDENTITY_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_SSO_IDENTITY_SKELETON)) +#define IS_SSO_IDENTITY_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_SSO_IDENTITY_SKELETON)) + +typedef struct _SsoIdentitySkeleton SsoIdentitySkeleton; +typedef struct _SsoIdentitySkeletonClass SsoIdentitySkeletonClass; +typedef struct _SsoIdentitySkeletonPrivate SsoIdentitySkeletonPrivate; + +struct _SsoIdentitySkeleton +{ + /*< private >*/ + GDBusInterfaceSkeleton parent_instance; + SsoIdentitySkeletonPrivate *priv; +}; + +struct _SsoIdentitySkeletonClass +{ + GDBusInterfaceSkeletonClass parent_class; +}; + +GType sso_identity_skeleton_get_type (void) G_GNUC_CONST; + +SsoIdentity *sso_identity_skeleton_new (void); + + +G_END_DECLS + +#endif /* __SSO_IDENTITY_GEN_H__ */ diff --git a/packaging/libgsignon-glib.changes b/packaging/libgsignon-glib.changes deleted file mode 120000 index 68cf068..0000000 --- a/packaging/libgsignon-glib.changes +++ /dev/null @@ -1 +0,0 @@ -../dists/rpm/libgsignon-glib-tizen.changes \ No newline at end of file diff --git a/packaging/libgsignon-glib.changes b/packaging/libgsignon-glib.changes new file mode 100644 index 0000000..e3410fc --- /dev/null +++ b/packaging/libgsignon-glib.changes @@ -0,0 +1,14 @@ +* Thu Mar 06 2014 Jussi Laako +- Release 2.1.0 including API alignment with libsignon-glib + +* Mon Nov 25 2013 Imran Zaman +- Release 2.0.3 that fixes unit test and spec file bugs + +* Fri Nov 22 2013 Imran Zaman +- Release 2.0.2 that fixes package licensing info and added docs + +* Mon Jun 24 2013 Imran Zaman +- Release 2.0.1 that comprises of bug fixes + +* Mon Jun 17 2013 Imran Zaman - 2.0.0 +- Prepare for first release of libgsignon-glib 2.0.0 diff --git a/packaging/libgsignon-glib.spec b/packaging/libgsignon-glib.spec deleted file mode 120000 index 1b75da4..0000000 --- a/packaging/libgsignon-glib.spec +++ /dev/null @@ -1 +0,0 @@ -../dists/rpm/libgsignon-glib-tizen.spec \ No newline at end of file diff --git a/packaging/libgsignon-glib.spec b/packaging/libgsignon-glib.spec new file mode 100644 index 0000000..b499273 --- /dev/null +++ b/packaging/libgsignon-glib.spec @@ -0,0 +1,67 @@ +#define dbus bus type to use [p2p, session, system] +%define dbus_type p2p + +Name: libgsignon-glib +Summary: GLib API for the SSO framework +Version: 2.1.0 +Release: 1 +Group: System/Libraries +License: LGPL-2.1 +Source: %{name}-%{version}.tar.gz +URL: https://01.org/gsso +Requires: dbus-1 +Requires: gsignon +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig +BuildRequires: pkgconfig(check) +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(gobject-2.0) +BuildRequires: pkgconfig(gio-2.0) + +%description +%{summary}. + + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +%{summary}. + + +%prep +%setup -q -n %{name}-%{version} + + +%build +%configure --enable-dbus-type=%{dbus_type} +make %{?_smp_mflags} + + +%install +rm -rf %{buildroot} +%make_install + + +%post -p /sbin/ldconfig + + +%postun -p /sbin/ldconfig + + +%files +%defattr(-,root,root,-) +%doc AUTHORS COPYING ChangeLog INSTALL NEWS README +%{_libdir}/%{name}.so.* + + +%files devel +%defattr(-,root,root,-) +%{_includedir}/%{name}/*.h +%{_libdir}/%{name}.so +%{_libdir}/pkgconfig/%{name}.pc +%{_datadir}/gtk-doc/html/%{name}/* +%{_bindir}/gsso-example + diff --git a/tests/check_signon.c b/tests/check_signon.c index 264f29c..afe291e 100644 --- a/tests/check_signon.c +++ b/tests/check_signon.c @@ -72,7 +72,9 @@ _run_mainloop () static void _setup () { +#if !GLIB_CHECK_VERSION (2, 36, 0) g_type_init (); +#endif if (main_loop == NULL) { main_loop = g_main_loop_new (NULL, FALSE); } @@ -129,7 +131,7 @@ new_identity() GHashTable *methods; guint id = 0; - idty = signon_identity_new (NULL); + idty = signon_identity_new (); fail_unless (SIGNON_IS_IDENTITY (idty)); methods = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (methods, "ssotest", ssotest_mechanisms); @@ -336,7 +338,7 @@ START_TEST(test_auth_session_query_mechanisms) GError *err = NULL; g_debug("%s", G_STRFUNC); - SignonIdentity *idty = signon_identity_new(NULL); + SignonIdentity *idty = signon_identity_new(); fail_unless (idty != NULL, "Cannot create Iddentity object"); SignonAuthSession *auth_session = signon_identity_create_session(idty, @@ -408,7 +410,7 @@ START_TEST(test_auth_session_query_mechanisms_nonexisting) GError *err = NULL; g_debug("%s", G_STRFUNC); - SignonIdentity *idty = signon_identity_new(NULL); + SignonIdentity *idty = signon_identity_new(); fail_unless (idty != NULL, "Cannot create Iddentity object"); SignonAuthSession *auth_session = signon_identity_create_session(idty, @@ -501,7 +503,7 @@ START_TEST(test_auth_session_creation) gboolean auth_sess_destroyed = FALSE; g_debug("%s", G_STRFUNC); - SignonIdentity *idty = signon_identity_new(NULL); + SignonIdentity *idty = signon_identity_new(); fail_unless (idty != NULL, "Cannot create Identity object"); SignonAuthSession *auth_session = signon_identity_create_session(idty, @@ -534,7 +536,7 @@ START_TEST(test_auth_session_process) GError *err = NULL; g_debug("%s", G_STRFUNC); - SignonIdentity *idty = signon_identity_new(NULL); + SignonIdentity *idty = signon_identity_new(); fail_unless (idty != NULL, "Cannot create Iddentity object"); SignonAuthSession *auth_session = signon_identity_create_session(idty, @@ -647,12 +649,12 @@ START_TEST(test_auth_session_process_failure) fail_unless (id != 0); - idty = signon_identity_new_from_db (id, NULL); + idty = signon_identity_new_from_db (id); fail_unless (idty != NULL, "Cannot create Identity object"); - auth_session = signon_auth_session_new (G_OBJECT (idty), - "ssotest", - &error); + auth_session = signon_auth_session_new_for_identity (idty, + "ssotest", + &error); fail_unless (auth_session != NULL, "Cannot create AuthSession object"); fail_unless (error == NULL); @@ -756,7 +758,7 @@ START_TEST(test_auth_session_process_after_store) g_debug("%s", G_STRFUNC); - idty = signon_identity_new (NULL); + idty = signon_identity_new (); fail_unless (SIGNON_IS_IDENTITY (idty), "Failed to initialize the Identity."); @@ -812,7 +814,7 @@ START_TEST(test_get_existing_identity) fail_unless (id != 0); - identity = signon_identity_new_from_db (id, NULL); + identity = signon_identity_new_from_db (id); fail_unless (identity != NULL); fail_unless (SIGNON_IS_IDENTITY (identity), @@ -830,7 +832,7 @@ END_TEST START_TEST(test_get_nonexisting_identity) { g_debug("%s", G_STRFUNC); - identity = signon_identity_new_from_db (G_MAXINT, NULL); + identity = signon_identity_new_from_db (G_MAXINT); fail_unless (identity != NULL); fail_unless (SIGNON_IS_IDENTITY (identity), @@ -879,7 +881,7 @@ static void store_credentials_identity_cb(SignonIdentity *self, START_TEST(test_store_credentials_identity) { g_debug("%s", G_STRFUNC); - SignonIdentity *idty = signon_identity_new(NULL); + SignonIdentity *idty = signon_identity_new(); fail_unless (idty != NULL); fail_unless (SIGNON_IS_IDENTITY (idty), "Failed to initialize the Identity."); @@ -930,7 +932,7 @@ static void identity_remove_cb(SignonIdentity *self, const GError *error, gpoint START_TEST(test_remove_identity) { g_debug("%s", G_STRFUNC); - SignonIdentity *idty = signon_identity_new (NULL); + SignonIdentity *idty = signon_identity_new (); fail_unless (idty != NULL); fail_unless (SIGNON_IS_IDENTITY (idty), "Failed to initialize the Identity."); @@ -946,7 +948,7 @@ START_TEST(test_remove_identity) * */ gint id = new_identity(); - SignonIdentity *idty2 = signon_identity_new_from_db (id, NULL); + SignonIdentity *idty2 = signon_identity_new_from_db (id); signon_identity_remove(idty2, identity_remove_cb, NULL); _run_mainloop (); @@ -974,7 +976,7 @@ static gboolean _contains(gchar **mechs, gchar *mech) return present; } -static void identity_info_cb(SignonIdentity *self, const SignonIdentityInfo *info, const GError *error, gpointer user_data) +static void identity_info_cb(SignonIdentity *self, SignonIdentityInfo *info, const GError *error, gpointer user_data) { if (error) { @@ -1070,7 +1072,7 @@ static SignonIdentityInfo *create_standard_info() START_TEST(test_info_identity) { g_debug("%s", G_STRFUNC); - SignonIdentity *idty = signon_identity_new (NULL); + SignonIdentity *idty = signon_identity_new (); fail_unless (idty != NULL); fail_unless (SIGNON_IS_IDENTITY (idty), "Failed to initialize the Identity."); @@ -1120,7 +1122,7 @@ START_TEST(test_info_identity) gint id = signon_identity_info_get_id (info); fail_unless (id != 0); - SignonIdentity *idty2 = signon_identity_new_from_db (id, NULL); + SignonIdentity *idty2 = signon_identity_new_from_db (id); signon_identity_query_info (idty2, identity_info_cb, &info); _run_mainloop (); @@ -1185,7 +1187,7 @@ START_TEST(test_signout_identity) { gboolean as1_destroyed = FALSE, as2_destroyed = FALSE; g_debug("%s", G_STRFUNC); - SignonIdentity *idty = signon_identity_new (NULL); + SignonIdentity *idty = signon_identity_new (); fail_unless (idty != NULL); fail_unless (SIGNON_IS_IDENTITY (idty), "Failed to initialize the Identity."); @@ -1201,7 +1203,7 @@ START_TEST(test_signout_identity) _run_mainloop (); gint id = signon_identity_info_get_id (info); - SignonIdentity *idty2 = signon_identity_new_from_db (id, NULL); + SignonIdentity *idty2 = signon_identity_new_from_db (id); /* wait some more time to ensure that the object gets registered */ g_timeout_add_seconds (2, test_quit_main_loop_cb, main_loop); @@ -1247,7 +1249,7 @@ END_TEST START_TEST(test_unregistered_identity) { g_debug("%s", G_STRFUNC); - SignonIdentity *idty = signon_identity_new (NULL); + SignonIdentity *idty = signon_identity_new (); fail_unless (idty != NULL); fail_unless (SIGNON_IS_IDENTITY (idty), "Failed to initialize the Identity."); @@ -1264,7 +1266,7 @@ START_TEST(test_unregistered_identity) * give the time for identity to became idle * */ sleep(SIGNOND_IDLE_TIMEOUT); - SignonIdentity *idty2 = signon_identity_new (NULL); + SignonIdentity *idty2 = signon_identity_new (); /* * give time to handle unregistered signal @@ -1283,7 +1285,7 @@ END_TEST START_TEST(test_unregistered_auth_session) { g_debug("%s", G_STRFUNC); - SignonIdentity *idty = signon_identity_new (NULL); + SignonIdentity *idty = signon_identity_new (); fail_unless (idty != NULL); fail_unless (SIGNON_IS_IDENTITY (idty), "Failed to initialize the Identity."); @@ -1300,7 +1302,7 @@ START_TEST(test_unregistered_auth_session) * give the time for identity to became idle * */ sleep(SIGNOND_IDLE_TIMEOUT); - SignonIdentity *idty2 = signon_identity_new (NULL); + SignonIdentity *idty2 = signon_identity_new (); /* * give time to handle unregistered signal @@ -1426,11 +1428,11 @@ START_TEST(test_regression_unref) guint id = new_identity(); fail_unless (id != 0); - idty = signon_identity_new_from_db (id, NULL); + idty = signon_identity_new_from_db (id); fail_unless (idty != NULL); - auth_session = signon_auth_session_new (G_OBJECT (idty), "ssotest", - &error); + auth_session = signon_auth_session_new_for_identity (idty, "ssotest", + &error); fail_unless (auth_session != NULL); session_data = g_hash_table_new (g_str_hash, g_str_equal); -- 2.7.4