The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Aut::Ticket - Authorization Framework - Tickets

SYNOPSIS

See Aut. =head1 ABSTRACT

'Aut::Ticket' is part of the 'Aut' authorization framework It provides tickets that are the user's access to services and application parts. It also provides encryption/decryption for user data.

DESCRIPTION

  • A ticket consists of an account, a password, user's rights and a key value used for symmetric encryption algorithms.

  • Rights are fully transparant for a ticket. The application context prescribes the rights that can be used. A ticket's rights value is just a string.

  • The key value, called seed in the Aut::Ticket context, is a (random) value of 32 digits, that is generated when a new ticket is made and can be set through public methods.

  • A ticket can be valid and invalid.

  • A ticket acts like a bag. You can set and get extra values to and from it.

Instantiating

new(account,password) --> Aut::Ticket

    This method initializes a ticket with a given account and password and generates a new seed.

Querying

valid() --> boolean

    Returns true, if the ticket is valid, returns False, otherwise.

rights() --> string

    Returns the currently assigned "rights" value to this ticket.

account() --> string

    Returns the currently assigned account for this ticket.

pass() --> string

    Returns the currently assigned password for this ticket.

seed() --> string

    Returns the seed value of this ticket that is being used for encryption/decryption.

get(var) --> string

    Gets value for 'var' from the ticket.

Setting

invalidate() --> void

    Invalidates a ticket.

set_rights(_rights) --> void

    Sets the rights value of the ticket to _rights.

set_pass(_pass) --> void

    Sets the password of the ticket to _pass.

set_seed(_seed) --> void

    Sets the seed value of the ticket (the encryption key) to _seed.

set(var,val) --> void

    Sets a variable 'var' in the ticket to value 'val'.

Encryption/Decryption

encrypt(text) --> base64 string

    Encrypts text using Aut::Crypt, with key seed(); returns a base64 encoded (with Aut::Base64) encrypted string.

decrypt(ciphertext) --> string

    Decrypts text using Aut::Crypt, after it has been decoded with Aut::Base64. If the decryption is valid, it returns the decrypted string, otherwise undef is returned.

SEE ALSO

Aut framework, Aut::Base64, Aut::Crypt.

AUTHOR

Hans Oesterholt-Dijkema <oesterhol@cpan.org>

COPYRIGHT AND LICENSE

This library is free software; you can redistribute it and/or modify it under Artistic license.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 307:

You forgot a '=back' before '=head1'