summaryrefslogtreecommitdiff
path: root/server/wallet-report
diff options
context:
space:
mode:
Diffstat (limited to 'server/wallet-report')
-rwxr-xr-xserver/wallet-report66
1 files changed, 57 insertions, 9 deletions
diff --git a/server/wallet-report b/server/wallet-report
index b5a2247..6508227 100755
--- a/server/wallet-report
+++ b/server/wallet-report
@@ -1,12 +1,11 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
# Wallet server reporting interface.
-##############################################################################
-# Declarations and globals
-##############################################################################
-
+use 5.008;
use strict;
+use warnings;
+
use Wallet::Report;
# The help output, sent in reply to the help command. Lists each supported
@@ -17,16 +16,22 @@ Wallet reporting help:
acls duplicate ACLs that duplicate another
acls empty All empty ACLs
acls entry <scheme> <id> ACLs containing this entry (wildcarded)
+ acls nesting <acl> ACLs containing this ACL as a nested entry
acls unused ACLs that are not referenced by any object
audit acls name ACLs failing the naming policy
audit objects name Objects failing the naming policy
objects All objects
objects acl <acl> Objects granting permissions to that ACL
objects flag <flag> Objects with that flag set
+ objects history History of all objects
+ objects host <hostname> All host-based objects for a specific host
objects owner <owner> Objects owned by that owner
objects type <type> Objects of that type
- objects unused Objects that have never been stored/gotten
+ objects unused Objects that have never been gotten
+ objects unstored Objects that have never been stored
owners <type> <name> All ACL entries owning matching objects
+ schemes All configured ACL schemes
+ types All configured wallet types
EOH
##############################################################################
@@ -74,7 +79,14 @@ sub command {
print $HELP;
} elsif ($command eq 'objects') {
die "too many arguments to objects\n" if @args > 2;
- my @objects = $report->objects (@args);
+ my @objects;
+ if (@args && $args[0] eq 'history') {
+ @objects = $report->objects_history (@args);
+ } elsif (@args && $args[0] eq 'host') {
+ @objects = $report->objects_hostname (@args);
+ } else {
+ @objects = $report->objects (@args);
+ }
if (!@objects and $report->error) {
die $report->error, "\n";
}
@@ -91,6 +103,20 @@ sub command {
for my $entry (@entries) {
print join (' ', @$entry), "\n";
}
+ } elsif ($command eq 'schemes') {
+ die "too many arguments to schemes\n" if @args > 0;
+ my @schemes = $report->acl_schemes;
+ for my $entry (@schemes) {
+ print join (' ', @$entry), "\n";
+ }
+
+ } elsif ($command eq 'types') {
+ die "too many arguments to types\n" if @args > 0;
+ my @types = $report->types;
+ for my $entry (@types) {
+ print join (' ', @$entry), "\n";
+ }
+
} else {
die "unknown command $command\n";
}
@@ -108,7 +134,7 @@ wallet-report - Wallet server reporting interface
=for stopwords
metadata ACL hostname backend acl acls wildcard SQL Allbery remctl
-MERCHANTABILITY NONINFRINGEMENT sublicense
+MERCHANTABILITY NONINFRINGEMENT sublicense unstored
=head1 SYNOPSIS
@@ -180,6 +206,10 @@ Returns all ACLs containing an entry with given scheme and identifier.
The scheme must be an exact match, but the <identifier> string will match
any identifier containing that string.
+=item acls nested <acl>
+
+Returns all ACLs that contain this ACL as a nested entry.
+
=item acls unused
Returns all ACLs that are not referenced by any of the objects in the
@@ -220,6 +250,8 @@ Displays a summary of all available commands.
=item objects unused
+=item objects unstored
+
Returns a list of objects in the database. Objects will be listed in the
form:
@@ -245,6 +277,12 @@ those where that ACL has any other, more limited permissions.
Returns all objects which have the given flag set.
+=item objects host <hostname>
+
+Returns all objects that belong to the given host. This requires adding
+local configuration to identify objects that belong to a given host. See
+L<Wallet::Config/"OBJECT HOST-BASED NAMES"> for more information.
+
=item objects owner <acl>
Returns all objects owned by the given ACL name or ID.
@@ -273,6 +311,14 @@ The output will be one line per ACL line in the form:
with duplicates suppressed.
+=item schemes
+
+Returns a list of all registered ACL schemes.
+
+=item types
+
+Returns a list of all registered object types.
+
=back
=head1 AUTHOR
@@ -281,7 +327,9 @@ Russ Allbery <eagle@eyrie.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2008, 2009, 2010, 2013 The Board of Trustees of the Leland
+Copyright 2016 Russ Allbery <eagle@eyrie.org>
+
+Copyright 2008, 2009, 2010, 2013, 2015 The Board of Trustees of the Leland
Stanford Junior University
Permission is hereby granted, free of charge, to any person obtaining a