Catalyst-Authentication-Credential-RedmineCookie

 view release on metacpan or  search on metacpan

.freebsd_meta_ports.yml  view on Meta::CPAN

---
category: www
portname: p5-Catalyst-Authentication-Credential-RedmineCookie

MANIFEST  view on Meta::CPAN

# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012.
.freebsd_meta_ports.yml
MANIFEST
META.json
META.yml
dist.ini
etc/mycontainer.pl
ex/rails3_cookie_to_json.rb
ex/rails4_cookie_to_json.rb
inc/MyContainer.pm
lib/Catalyst/Authentication/Credential/RedmineCookie.pm
lib/Catalyst/Authentication/RedmineCookie/Schema.pm
lib/Catalyst/Authentication/RedmineCookie/Schema/Result/GroupsUsers.pm
lib/Catalyst/Authentication/RedmineCookie/Schema/Result/MemberRoles.pm
lib/Catalyst/Authentication/RedmineCookie/Schema/Result/Members.pm
lib/Catalyst/Authentication/RedmineCookie/Schema/Result/Roles.pm
lib/Catalyst/Authentication/RedmineCookie/Schema/Result/RolesManagedRoles.pm
lib/Catalyst/Authentication/RedmineCookie/Schema/Result/UserPreferences.pm
lib/Catalyst/Authentication/RedmineCookie/Schema/Result/Users.pm
script/schema_loader.pl
t/TestApp/lib/TestApp.pm
t/TestApp/lib/TestApp/Controller/Root.pm
t/TestApp/lib/TestApp/Model/DBIC.pm
t/TestApp/script/web_server.pl

META.json  view on Meta::CPAN

   ],
   "dynamic_config" : 0,
   "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : 2
   },
   "name" : "Catalyst-Authentication-Credential-RedmineCookie",
   "prereqs" : {
      "runtime" : {
         "requires" : {
            "JSON::MaybeXS" : "1"
         }
      }
   },
   "release_status" : "stable",
   "version" : "0.01",
   "x_generated_by_perl" : "v5.28.2",

META.yml  view on Meta::CPAN

abstract: 'Decode the redmine cookie _redmine_session'
author:
  - 'Tomohiro Hosaka <bokutin@bokut.in>'
build_requires: {}
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Catalyst-Authentication-Credential-RedmineCookie
requires:
  JSON::MaybeXS: '1'
version: '0.01'
x_generated_by_perl: v5.28.2
x_serialization_backend: 'YAML::Tiny version 1.73'

dist.ini  view on Meta::CPAN

name             = Catalyst-Authentication-Credential-RedmineCookie
version          = 0.01
author           = Tomohiro Hosaka <bokutin@bokut.in>
license          = Perl_5
copyright_year   = 2020
copyright_holder = Tomohiro Hosaka

[GatherDir]
include_dotfiles = 1
exclude_match = _local.pl$
[PruneCruft]

etc/mycontainer.pl  view on Meta::CPAN

{
    web => {
        'Plugin::Authentication' => {
            default_realm => 'redmine_cookie',
            realms => {
                redmine_cookie => {
                    credential => {
                        class => 'RedmineCookie',
                        # examples
                        # cmd   => [qw(ssh redmine.server /root/rails4_cookie_to_json.rb)],
                        # cmd   => [qw(sudo jexec redmine /root/rails4_cookie_to_json.rb)],
                    },
                    # It does not specify a store, it works with NullStore.
                    # store => {
                    #     class => 'DBIx::Class',
                    #     user_model => 'DBIC::Users',
                    # }
                },
            },
        },
        # Not required for NullStore.
        # 'Model::DBIC' => {
        #     schema_class => "Catalyst::Authentication::RedmineCookie::Schema",
        #     connect_info => [
        #         "DBI:mysql:database=redmine", 'user', 'pass',
        #         {
        #             RaiseError        => 1,
        #             PrintError        => 0,
        #             AutoCommit        => 1,
        #             pg_enable_utf8    => 1, # for pg
        #             mysql_enable_utf8 => 1, # for mysql
        #         }
        #     ],

lib/Catalyst/Authentication/Credential/RedmineCookie.pm  view on Meta::CPAN

package Catalyst::Authentication::Credential::RedmineCookie;

use Moose;

use IPC::Open2;
use JSON::MaybeXS qw(:legacy);
use POSIX ":sys_wait_h";

has cmd => ( is => 'ro', isa => 'Str|ArrayRef', required => 1 );

# /jails/logserver/usr/local/lib/ruby/gems/2.6/gems/rack-1.6.11/lib/rack/session/cookie.rb

lib/Catalyst/Authentication/Credential/RedmineCookie.pm  view on Meta::CPAN

}

no Moose;
__PACKAGE__->meta->make_immutable;
1;

=encoding utf8

=head1 NAME

Catalyst::Authentication::Credential::RedmineCookie - Decode the redmine cookie _redmine_session

=head1 SYNOPSIS

    package TestApp;
    use base qw(Catalyst);
    __PACKAGE__->config(
        'Plugin::Authentication' => {
            default_realm => 'redmine_cookie',
            realms => {
                redmine_cookie => {
                    credential => {
                        class => 'RedmineCookie',
                        # examples
                        cmd   => [qw(ssh redmine.server /root/rails4_cookie_to_json.rb)],
                        cmd   => [qw(sudo jexec redmine /root/rails4_cookie_to_json.rb)],
                    },
                    # It does not specify a store, it works with NullStore.
                    store => {
                        class => 'DBIx::Class',
                        user_model => 'DBIC::Users',
                    }
                },
            },
        },
        # Not required for NullStore.
        'Model::DBIC' => {
            schema_class => "Catalyst::Authentication::RedmineCookie::Schema",
            connect_info => [
                "DBI:mysql:database=redmine", 'user', 'pass',
                {
                    RaiseError        => 1,
                    PrintError        => 0,
                    AutoCommit        => 1,
                    pg_enable_utf8    => 1, # for pg
                    mysql_enable_utf8 => 1, # for mysql
                }
            ],

lib/Catalyst/Authentication/Credential/RedmineCookie.pm  view on Meta::CPAN

    }

    1;

=head1 AUTHOR

Tomohiro Hosaka, E<lt>bokutin@bokut.inE<gt>

=head1 COPYRIGHT AND LICENSE

The Catalyst::Authentication::Credential::RedmineCookie module is

Copyright (C) 2020 by Tomohiro Hosaka

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.0 or,
at your option, any later version of Perl 5 you may have available.

=cut

lib/Catalyst/Authentication/RedmineCookie/Schema.pm  view on Meta::CPAN

use utf8;
package Catalyst::Authentication::RedmineCookie::Schema;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Schema';

__PACKAGE__->load_namespaces(
    default_resultset_class => "+DBIx::Class::ResultSet::HashRef",
);


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-01-08 15:50:54
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dHVAPbDcEF+upQSQ5OuNog

# find /usr/local/www/redmine/app/models -type f | sort | xargs greple -pe '^\s*(has_many|belongs_to|might_have|has_one|many_to_many|has_and_belongs_to_many) 

use aliased "Catalyst::Authentication::RedmineCookie::Schema::Result::GroupsUsers";
use aliased "Catalyst::Authentication::RedmineCookie::Schema::Result::MemberRoles";
use aliased "Catalyst::Authentication::RedmineCookie::Schema::Result::Members";
use aliased "Catalyst::Authentication::RedmineCookie::Schema::Result::Roles";
use aliased "Catalyst::Authentication::RedmineCookie::Schema::Result::RolesManagedRoles";
use aliased "Catalyst::Authentication::RedmineCookie::Schema::Result::UserPreferences";
use aliased "Catalyst::Authentication::RedmineCookie::Schema::Result::Users";

GroupsUsers->belongs_to( user  => Users, 'user_id'  );
GroupsUsers->belongs_to( group => Users, 'group_id' );

Members->belongs_to( user => Users, 'user_id' );
Members->has_many( member_role => MemberRoles, 'member_id' );

Users->has_many( groups_users => GroupsUsers, 'user_id' );
Users->many_to_many( groups => group_users => 'group' );

lib/Catalyst/Authentication/RedmineCookie/Schema/Result/GroupsUsers.pm  view on Meta::CPAN

use utf8;
package Catalyst::Authentication::RedmineCookie::Schema::Result::GroupsUsers;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Core';
__PACKAGE__->table("groups_users");
__PACKAGE__->add_columns(

lib/Catalyst/Authentication/RedmineCookie/Schema/Result/MemberRoles.pm  view on Meta::CPAN

use utf8;
package Catalyst::Authentication::RedmineCookie::Schema::Result::MemberRoles;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Core';
__PACKAGE__->table("member_roles");
__PACKAGE__->add_columns(

lib/Catalyst/Authentication/RedmineCookie/Schema/Result/Members.pm  view on Meta::CPAN

use utf8;
package Catalyst::Authentication::RedmineCookie::Schema::Result::Members;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Core';
__PACKAGE__->table("members");
__PACKAGE__->add_columns(

lib/Catalyst/Authentication/RedmineCookie/Schema/Result/Roles.pm  view on Meta::CPAN

use utf8;
package Catalyst::Authentication::RedmineCookie::Schema::Result::Roles;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Core';
__PACKAGE__->table("roles");
__PACKAGE__->add_columns(

lib/Catalyst/Authentication/RedmineCookie/Schema/Result/RolesManagedRoles.pm  view on Meta::CPAN

use utf8;
package Catalyst::Authentication::RedmineCookie::Schema::Result::RolesManagedRoles;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Core';
__PACKAGE__->table("roles_managed_roles");
__PACKAGE__->add_columns(

lib/Catalyst/Authentication/RedmineCookie/Schema/Result/UserPreferences.pm  view on Meta::CPAN

use utf8;
package Catalyst::Authentication::RedmineCookie::Schema::Result::UserPreferences;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Core';
__PACKAGE__->table("user_preferences");
__PACKAGE__->add_columns(

lib/Catalyst/Authentication/RedmineCookie/Schema/Result/Users.pm  view on Meta::CPAN

use utf8;
package Catalyst::Authentication::RedmineCookie::Schema::Result::Users;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Core';
__PACKAGE__->table("users");
__PACKAGE__->add_columns(

script/schema_loader.pl  view on Meta::CPAN

#!/usr/bin/env perl

use rlib;
use Modern::Perl;

use Class::Load qw(try_load_class);
use DBIx::Class::Schema::Loader qw(make_schema_at);

my $default_resultset_class = do {
    my $candidate = "Catalyst::Authentication::RedmineCookie::Base::Schema::ResultSet";
    my $ret = try_load_class $candidate;
    $ret ? "+$candidate" : "+DBIx::Class::ResultSet::HashRef";
};
my $result_base_class       = do {
    my $candidate = "Catalyst::Authentication::RedmineCookie::Base::Schema::Core";
    my $ret = try_load_class $candidate;
    $ret ? "$candidate" : undef; # こっちは + を付けなくて良い
};

# find /usr/local/www/redmine/app/models -type f | sort | xargs greple -pe '^\s*(has_many|belongs_to|might_have|has_one|many_to_many|has_and_belongs_to_many)' | less 

make_schema_at(
    "Catalyst::Authentication::RedmineCookie::Schema",
    {
        _components => [
            "IntrospectableM2M",
        ],
        datetime_timezone => "Asia/Tokyo",
        datetime_locale   => "ja_JP",
        ( $default_resultset_class ? ( default_resultset_class => $default_resultset_class ) : () ),
        dump_directory => './lib',
        constraint => qr/^(user|group|member|role)/i,
        exclude    => qr/managed/i,



( run in 1.368 second using v1.01-cache-2.11-cpan-e9199f4ba4c )