Akamai-Edgegrid

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


    Search CPAN
        http://search.cpan.org/dist/edgegrid-perl/

AUTHOR

Jonathan Landis <jlandis@akamai.com>

LICENSE AND COPYRIGHT

Copyright (C) 2014 Akamai Technologies, Inc. All rights reserved

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    L<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

lib/Akamai/Edgegrid.pm  view on Meta::CPAN

    KEY           SOURCE
    ------------- -----------------------------------------------
    client_token  from "Credentials" section of Manage APIs UI
    client_secret from "Credentials" section of Manage APIs UI
    access_token  from "Authorizations" section of Manage APIs UI

The following optional key/value pairs may be provided:

    KEY             DESCRIPTION
    --------------- -------------------------------------------------------
    debug           if true enables additional logging
    headers_to_sign listref of header names to sign (in order) (default [])
    max_body        maximum body size for POSTS (default 2048)

=cut

sub new {
    my $class = shift @_;
    my %args = @_;

    my @local_args = qw(config_file section client_token client_secret access_token headers_to_sign max_body debug);

lib/Akamai/Edgegrid.pm  view on Meta::CPAN


=item * Search CPAN

L<http://search.cpan.org/dist/edgegrid-perl/>

=back


=head1 LICENSE AND COPYRIGHT

Copyright 2014 Akamai Technologies, Inc. All rights reserved

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    L<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

t/01-testrequests.t  view on Meta::CPAN

my $numtests = scalar @{$testdata->{tests}};

plan tests => $numtests;

for my $test (@{$testdata->{tests}}) {
    run_test($testdata, $test);
}

=head1 LICENSE AND COPYRIGHT

Copyright 2014 Akamai Technologies, Inc. All rights reserved

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    L<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

t/02-badinputs.t  view on Meta::CPAN

    my $msg = $@;
    like($msg, qr/^missing required argument/, 'missing all');
}

for my $a (@required) {
    test_missing($a);
}

=head1 LICENSE AND COPYRIGHT

Copyright 2014 Akamai Technologies, Inc. All rights reserved

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    L<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

t/03-timestamp.t  view on Meta::CPAN

            :
            [0-5][0-9] # second
            \+0000 # timezone
        $
    /x,
    'timestamp structure'
);

=head1 LICENSE AND COPYRIGHT

Copyright 2014 Akamai Technologies, Inc. All rights reserved

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    L<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

t/04-defaultargs.t  view on Meta::CPAN

plan tests=>2;

my $ua = new Akamai::Edgegrid(client_token=>'xxx', client_secret=>'xxx',
    access_token=>'xxx');

is($ua->{max_body},131072 , 'default max_body=131072');
is_deeply($ua->{headers_to_sign}, [], 'default headers_to_sign=[]');

=head1 LICENSE AND COPYRIGHT

Copyright 2014 Akamai Technologies, Inc. All rights reserved

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    L<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

t/05-nonce.t  view on Meta::CPAN


my %nonces = ();
while ($count--) {
    my $n = Akamai::Edgegrid::_new_nonce();
    ok(!exists $nonces{$n});
    $nonces{$n} = $n;
}

=head1 LICENSE AND COPYRIGHT

Copyright 2014 Akamai Technologies, Inc. All rights reserved

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    L<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.



( run in 4.181 seconds using v1.01-cache-2.11-cpan-0371d4a6215 )