All this module supports so far is creating a Kerberos context.
/_build/
/blib/
/cover_db
+/lib/Authen/Kerberos.c
/lib/Authen/Kerberos/Kadmin.c
*.o
--- /dev/null
+# Perl bindings for the Kerberos API.
+#
+# This is the Perl boostrap file for the Authen::Kerberos module, nearly all
+# of which is implemented in XS. For the actual source, see Kerberos.xs.
+# This file contains the bootstrap and export code and the documentation.
+#
+# Currently, this only provides an interface to the Heimdal libkrb5 library.
+# This module will eventually become a level of indirection that can select
+# from several XS modules to support both MIT Kerberos and Heimdal.
+#
+# Written by Russ Allbery <eagle@eyrie.org>
+# Copyright 2014
+# The Board of Trustees of the Leland Stanford Junior University
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+package Authen::Kerberos;
+
+use 5.010;
+use strict;
+use warnings;
+
+use base qw(DynaLoader);
+
+use Authen::Kerberos::Exception;
+use Exporter qw(import);
+
+our $VERSION;
+
+# Set $VERSION in a BEGIN block for robustness.
+BEGIN {
+ $VERSION = '0.02';
+}
+
+# Load the binary module.
+bootstrap Authen::Kerberos $VERSION;
+
+1;
+__END__
+
+=for stopwords
+Allbery Heimdal keytabs libkrb5
+
+=head1 NAME
+
+Authen::Kerberos - Perl bindings for the Kerberos API
+
+=head1 SYNOPSIS
+
+ use Authen::Kerberos;
+
+ my $krb5 = Authen::Kerberos->new;
+
+=head1 REQUIREMENTS
+
+Perl 5.10 or later and the Heimdal libkrb5 library.
+
+=head1 DESCRIPTION
+
+Authen::Kerberos provides Perl bindings for the Kerberos library API, used
+to perform Kerberos operations such as acquiring tickets and examining
+ticket caches and keytabs.
+
+Currently, this module only supports Heimdal and only supports a small
+fraction of the Kerberos library API. More functionality will be added
+later.
+
+=head1 CLASS METHODS
+
+All class methods throw Authen::Kerberos::Exception objects on any error.
+
+=over 4
+
+=item new([ARGS])
+
+Create a new Authen::Kerberos object, which holds the internal library
+state. All further operations must be done with this object.
+
+=back
+
+=head1 AUTHOR
+
+Russ Allbery <eagle@eyrie.org>
+
+=head1 SEE ALSO
+
+L<Authen::Kerberos::Exception>
+
+=cut
--- /dev/null
+/* -*- c -*-
+ * Perl bindings for the Kerberos API
+ *
+ * This is an XS source file, suitable for processing by xsubpp, that
+ * generates Perl bindings for the Kerberos API (libkrb5). It also provides
+ * enough restructuring so that the C function calls can be treated as method
+ * calls on a Kerberos context object.
+ *
+ * Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2014
+ * The Board of Trustees of the Leland Stanford Junior University
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <EXTERN.h>
+#include <perl.h>
+#include <XSUB.h>
+
+#include <krb5.h>
+
+/*
+ * This typedefs are needed for xsubpp to work its magic with type translation
+ * to Perl objects. The krb5_context pointer is used as the Authen::Kerberos
+ * object, wrapped in an SV and blessed.
+ */
+typedef krb5_context Authen__Kerberos;
+
+
+/* XS code below this point. */
+
+MODULE = Authen::Kerberos PACKAGE = Authen::Kerberos
+
+PROTOTYPES: DISABLE
+
+
+Authen::Kerberos
+new(class)
+ const char *class
+ PREINIT:
+ krb5_context ctx;
+ krb5_error_code code;
+ CODE:
+{
+ code = krb5_init_context(&ctx);
+ if (code != 0)
+ krb5_croak(NULL, code, "krb5_init_context", FALSE);
+ RETVAL = ctx;
+}
+ OUTPUT:
+ RETVAL
+
+
+void
+DESTROY(self)
+ Authen::Kerberos self
+ CODE:
+{
+ if (self != NULL)
+ krb5_free_context(self);
+}
--- /dev/null
+[libdefaults]
+ default_realm = TEST.EXAMPLE.COM
--- /dev/null
+#!/usr/bin/perl
+#
+# Test suite for Authen::Kerberos basic functionality.
+#
+# Written by Russ Allbery <eagle@eyrie.org>
+# Copyright 2014
+# The Board of Trustees of the Leland Stanford Junior University
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+use 5.010;
+use autodie;
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+BEGIN {
+ use_ok('Authen::Kerberos');
+}
+
+# Force use of our local krb5.conf so that testing doesn't depend on the local
+# system Kerberos configuration.
+local $ENV{KRB5_CONFIG} = 't/data/krb5.conf';
+
+# Test creation of a Kerberos context (Authen::Kerberos object).
+my $krb5 = Authen::Kerberos->new;
+isa_ok($krb5, 'Authen::Kerberos');
-# Typemap file for the Perl bindings to the Kerberos library.
+# Typemap file for the Perl bindings to the Kerberos library. -*- conf -*-
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2014
TYPEMAP
+Authen::Kerberos T_PTROBJ_NU
Authen::Kerberos::Kadmin T_PTROBJ_NU
INPUT