|
Packit |
fd8b60 |
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
Packit |
fd8b60 |
/* kadmin/server/auth.h - kadmin authorization declarations */
|
|
Packit |
fd8b60 |
/*
|
|
Packit |
fd8b60 |
* Copyright (C) 2017 by the Massachusetts Institute of Technology.
|
|
Packit |
fd8b60 |
* All rights reserved.
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* Redistribution and use in source and binary forms, with or without
|
|
Packit |
fd8b60 |
* modification, are permitted provided that the following conditions
|
|
Packit |
fd8b60 |
* are met:
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* * Redistributions of source code must retain the above copyright
|
|
Packit |
fd8b60 |
* notice, this list of conditions and the following disclaimer.
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* * Redistributions in binary form must reproduce the above copyright
|
|
Packit |
fd8b60 |
* notice, this list of conditions and the following disclaimer in
|
|
Packit |
fd8b60 |
* the documentation and/or other materials provided with the
|
|
Packit |
fd8b60 |
* distribution.
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
Packit |
fd8b60 |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
Packit |
fd8b60 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
Packit |
fd8b60 |
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
Packit |
fd8b60 |
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
|
Packit |
fd8b60 |
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
Packit |
fd8b60 |
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
Packit |
fd8b60 |
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
Packit |
fd8b60 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
Packit |
fd8b60 |
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
Packit |
fd8b60 |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
Packit |
fd8b60 |
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
fd8b60 |
*/
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
#ifndef AUTH_H
|
|
Packit |
fd8b60 |
#define AUTH_H
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
#define OP_ADDPRINC 1
|
|
Packit |
fd8b60 |
#define OP_MODPRINC 2
|
|
Packit |
fd8b60 |
#define OP_SETSTR 3
|
|
Packit |
fd8b60 |
#define OP_CPW 4
|
|
Packit |
fd8b60 |
#define OP_CHRAND 5
|
|
Packit |
fd8b60 |
#define OP_SETKEY 6
|
|
Packit |
fd8b60 |
#define OP_PURGEKEYS 7
|
|
Packit |
fd8b60 |
#define OP_DELPRINC 8
|
|
Packit |
fd8b60 |
#define OP_RENPRINC 9
|
|
Packit |
fd8b60 |
#define OP_GETPRINC 10
|
|
Packit |
fd8b60 |
#define OP_GETSTRS 11
|
|
Packit |
fd8b60 |
#define OP_EXTRACT 12
|
|
Packit |
fd8b60 |
#define OP_LISTPRINCS 13
|
|
Packit |
fd8b60 |
#define OP_ADDPOL 14
|
|
Packit |
fd8b60 |
#define OP_MODPOL 15
|
|
Packit |
fd8b60 |
#define OP_DELPOL 16
|
|
Packit |
fd8b60 |
#define OP_GETPOL 17
|
|
Packit |
fd8b60 |
#define OP_LISTPOLS 18
|
|
Packit |
fd8b60 |
#define OP_IPROP 19
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
/* Initialize all authorization modules. */
|
|
Packit |
fd8b60 |
krb5_error_code auth_init(krb5_context context, const char *acl_file);
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
/* Release authorization module state. */
|
|
Packit |
fd8b60 |
void auth_fini(krb5_context context);
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
/* Authorize the operation given by opcode, using the appropriate subset of p1,
|
|
Packit |
fd8b60 |
* p2, s1, s2, polent, and mask. */
|
|
Packit |
fd8b60 |
krb5_boolean auth(krb5_context context, int opcode,
|
|
Packit |
fd8b60 |
krb5_const_principal client, krb5_const_principal p1,
|
|
Packit |
fd8b60 |
krb5_const_principal p2, const char *s1, const char *s2,
|
|
Packit |
fd8b60 |
const kadm5_policy_ent_rec *polent, long mask);
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
/* Authorize an add-principal or modify-principal operation, and apply
|
|
Packit |
fd8b60 |
* restrictions to ent and mask if any modules supply them. */
|
|
Packit |
fd8b60 |
krb5_boolean auth_restrict(krb5_context context, int opcode,
|
|
Packit |
fd8b60 |
krb5_const_principal client,
|
|
Packit |
fd8b60 |
kadm5_principal_ent_t ent, long *mask);
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
/* Notify modules that the most recent authorized operation has ended. */
|
|
Packit |
fd8b60 |
void auth_end(krb5_context context);
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
/* initvt declarations for built-in modules */
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
krb5_error_code kadm5_auth_acl_initvt(krb5_context context, int maj_ver,
|
|
Packit |
fd8b60 |
int min_ver, krb5_plugin_vtable vtable);
|
|
Packit |
fd8b60 |
krb5_error_code kadm5_auth_self_initvt(krb5_context context, int maj_ver,
|
|
Packit |
fd8b60 |
int min_ver, krb5_plugin_vtable vtable);
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
#endif /* AUTH_H */
|