
Metabase::Gateway - Manage Metabase fact submission

version 1.001

use strict;
use warnings;
package Custom::Metabase;
use Moose;
with 'Metabase::Gateway';
sub _build_fact_classes { ... }
sub _build_public_librarian { ... }
sub _build_private_librarian { ... }
my $mg = Custom::Gateway->new( @args ); $mg->handle_submission( $fact_struct, $user_guid, $user_secret);

The Metabase::Gateway role manages submissions to the Metabase. It provides fact and submitter validation or authorization before storing new facts in a Metabase.

The following builders must be provided by the class that applies this role. All three are lazy.
_build_fact_classesThis builder must return an array reference of Metabase::Fact subclasses.
_build_public_librarian_build_private_librarianThese builders must return Metabase::Librarian objects.
disable_securityA boolean option. If true, submitter profiles will not be authenticated. (This is generally useful for testing, only.) Default is false.
allow_registrationA boolean option. If true, new submitter profiles and secrets may be stored. Default is true.
authentication_timeoutNumber of seconds to cache user authentication data. Defaults to 600.
cache_optionsA hash reference of constructor arguments for a CHI cache. Defaults to { driver => 'Memory' }.
approved_typesReturns a list of approved fact types. Used for validating submitted facts.
A "type" is a class name with "::" converted to "-", so this attribute returns an arrayref of the fact_classes attribute converted to types.
fact_classesArray reference containing a list of valid Metabase::Fact subclasses. Only facts from these classes may be added to the Metabase.
public_librarianA librarian object to manage fact data.
private_librarianA librarian object to manage user authentication data and possibly other facts that should be segregated from searchable and retrievable facts. This should not be the same as the public_librarian.
enqueue$mg->enqueue( $fact );
Add a fact from a user (identified by a profile) via the public_librarian. Used internally by handle_submission.
handle_submission$mg->handle_submission( $fact_struct, $user_guid, $user_secret);
Extract a fact a deserialized data structure and add it to the Metabase via the public_librarian. The fact is regenerated from the as_struct method.
handle_registration$mg->handle_registration( $profile_struct, $secret_struct );
Extract a new user profile and secret from deserialized data structures and add them via the public_librarian and private_librarian, respectively.


This software is Copyright (c) 2012 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004