Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michalsn/codeigniter-signed-url
Sign URLs in your CodeIgniter 4 application.
https://github.com/michalsn/codeigniter-signed-url
codeigniter codeigniter4 php php8 signed-url
Last synced: 3 months ago
JSON representation
Sign URLs in your CodeIgniter 4 application.
- Host: GitHub
- URL: https://github.com/michalsn/codeigniter-signed-url
- Owner: michalsn
- License: mit
- Created: 2022-12-27T06:28:42.000Z (about 2 years ago)
- Default Branch: develop
- Last Pushed: 2024-01-22T10:14:47.000Z (almost 1 year ago)
- Last Synced: 2024-10-01T00:41:21.119Z (4 months ago)
- Topics: codeigniter, codeigniter4, php, php8, signed-url
- Language: PHP
- Homepage: https://michalsn.github.io/codeigniter-signed-url
- Size: 688 KB
- Stars: 19
- Watchers: 6
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# CodeIgniter Signed URL
Prevent manual URL manipulation and auto expiry URLs.
[![PHPUnit](https://github.com/michalsn/codeigniter-signed-url/actions/workflows/phpunit.yml/badge.svg)](https://github.com/michalsn/codeigniter-signed-url/actions/workflows/phpunit.yml)
[![PHPStan](https://github.com/michalsn/codeigniter-signed-url/actions/workflows/phpstan.yml/badge.svg)](https://github.com/michalsn/codeigniter-signed-url/actions/workflows/phpstan.yml)
[![Deptrac](https://github.com/michalsn/codeigniter-signed-url/actions/workflows/deptrac.yml/badge.svg)](https://github.com/michalsn/codeigniter-signed-url/actions/workflows/deptrac.yml)
[![Coverage Status](https://coveralls.io/repos/github/michalsn/codeigniter-signed-url/badge.svg?branch=develop)](https://coveralls.io/github/michalsn/codeigniter-signed-url?branch=develop)## Installation
composer require michalsn/codeigniter-signed-url
## Overview
We can sign URLs very easy with two main methods that act similar to the helper functions known from CodeIgniter's URL helper.
```php
echo signedurl()->siteUrl('controller/method?query=string');
// https://example.com/controller/method?query=string&signature=signature-goes-here
``````php
echo signedurl()->setExpiration(DAY * 2)->urlTo('namedRoute', 12);
// https://example.com/route/name/12?expiration=1671980371&signature=signature-goes-here
```## Versions
Versions are not compatible - URLs generated in one version of Signed URL will not work with another version.
| CodeIgniter version | Signed URL version |
|---------------------|--------------------|
| `>= 4.4` | `2.*` |
| `< 4.4` | `1.*` |## Docs
https://michalsn.github.io/codeigniter-signed-url