-
Notifications
You must be signed in to change notification settings - Fork 0
feat: php sdk #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5e9a7b9
feat: php sdk
DanielHougaard 2782dd0
Update packagist.yml
DanielHougaard 9354d79
Update packagist.yml
DanielHougaard 4e801e8
Update .php-cs-fixer.php
DanielHougaard 06770a2
Update phpstan.neon
DanielHougaard d86575d
requested changes
DanielHougaard 606f2c2
testing
DanielHougaard df4e685
Update composer.json
DanielHougaard 8f772e5
Update ci.yml
DanielHougaard ea147b7
Update composer.json
DanielHougaard 1d4dbc9
further testing
DanielHougaard ea3408a
minor fixes
DanielHougaard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| php: [8.1, 8.2, 8.3] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite | ||
| coverage: xdebug | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install | ||
|
|
||
| - name: Run PHPStan | ||
| run: composer phpstan | ||
|
|
||
| - name: Validate composer.json | ||
| run: composer validate | ||
|
|
||
| - name: Check for security vulnerabilities | ||
| run: composer audit --format=json --no-interaction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Deploy to Packagist | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*.*.*" | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: "8.1" | ||
| extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install --no-dev --optimize-autoloader | ||
|
|
||
| - name: Validate composer.json | ||
| run: composer validate | ||
|
|
||
| - name: Check for security vulnerabilities | ||
| run: composer audit --format=json --no-interaction | ||
|
|
||
| publish-to-packagist: | ||
| name: publish | ||
| runs-on: ubuntu-latest | ||
| needs: deploy | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Publish to Packagist | ||
| run: |- | ||
| curl --fail-with-body -X POST -H 'Content-Type: application/json' "https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_API_KEY}" -d '{"repository":"github.com/Infisical/php-sdk"}' | ||
| env: | ||
| PACKAGIST_USERNAME: ${{ secrets.PACKAGIST_USERNAME }} | ||
| PACKAGIST_API_KEY: ${{ secrets.PACKAGIST_API_KEY }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,37 @@ | ||
| # the composer package lock file and install directory | ||
| # Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file | ||
| # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file | ||
| # /composer.lock | ||
| /fuel/vendor | ||
|
|
||
| # the fuelphp document | ||
| /docs/ | ||
|
|
||
| # you may install these packages with `oil package`. | ||
| # http://fuelphp.com/docs/packages/oil/package.html | ||
| # /fuel/packages/auth/ | ||
| # /fuel/packages/email/ | ||
| # /fuel/packages/oil/ | ||
| # /fuel/packages/orm/ | ||
| # /fuel/packages/parser/ | ||
|
|
||
| # dynamically generated files | ||
| /fuel/app/logs/*/*/* | ||
| /fuel/app/cache/*/* | ||
| /fuel/app/config/crypt.php | ||
| # Composer | ||
| /vendor/ | ||
| composer.lock | ||
|
|
||
| # PHPUnit | ||
| .phpunit.cache/ | ||
| .phpunit.result.cache | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Logs | ||
| *.log | ||
|
|
||
| # Environment files | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Build artifacts | ||
| /build/ | ||
| /dist/ | ||
|
|
||
| # Coverage reports | ||
| /coverage/ | ||
| /html-coverage/ | ||
|
|
||
| # Temporary files | ||
| *.tmp | ||
| *.temp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <?php | ||
|
|
||
| require_once __DIR__ . '/vendor/autoload.php'; | ||
|
|
||
| $finder = PhpCsFixer\Finder::create() | ||
| ->in([__DIR__ . '/src', __DIR__ . '/tests']) | ||
| ->exclude('vendor'); | ||
|
|
||
| return (new PhpCsFixer\Config()) | ||
| ->setRules([ | ||
| '@PSR12' => true, | ||
| 'array_syntax' => ['syntax' => 'short'], | ||
| 'ordered_imports' => ['sort_algorithm' => 'alpha'], | ||
| 'no_unused_imports' => true, | ||
| 'not_operator_with_successor_space' => true, | ||
| 'trailing_comma_in_multiline' => true, | ||
| 'phpdoc_scalar' => true, | ||
| 'unary_operator_spaces' => true, | ||
| 'binary_operator_spaces' => true, | ||
| 'blank_line_before_statement' => [ | ||
| 'statements' => [ | ||
| 'break', | ||
| 'continue', | ||
| 'declare', | ||
| 'return', | ||
| 'throw', | ||
| 'try', | ||
| ], | ||
| ], | ||
| 'phpdoc_single_line_var_spacing' => true, | ||
| 'phpdoc_var_without_name' => true, | ||
| 'method_argument_space' => [ | ||
| 'on_multiline' => 'ensure_fully_multiline', | ||
| 'keep_multiple_spaces_after_comma' => true, | ||
| ], | ||
| 'single_trait_insert_per_statement' => true, | ||
| ]) | ||
| ->setFinder($finder); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <h1 align="center"> | ||
| <img width="300" src="/resources/logo.svg#gh-dark-mode-only" alt="infisical"> | ||
| </h1> | ||
| <p align="center"> | ||
| <p align="center"><b>Infisical PHP SDK</b></p> | ||
| <h4 align="center"> | ||
| | <a href="https://infisical.com/slack">Slack</a> | | ||
| <a href="https://infisical.com/">Infisical</a> | | ||
| <a href="https://infisical.com/docs/sdks/languages/php">Documentation</a> | | ||
| </h4> | ||
|
|
||
| <h4 align="center"> | ||
| <a href="https://github.com/Infisical/php-sdk/blob/main/LICENSE"> | ||
| <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Infisical PHP SDK is released under the MIT license." /> | ||
| </a> | ||
| <a href="https://infisical.com/slack"> | ||
| <img src="https://img.shields.io/badge/chat-on%20Slack-blueviolet" alt="Slack community channel" /> | ||
| </a> | ||
| <a href="https://twitter.com/infisical"> | ||
| <img src="https://img.shields.io/twitter/follow/infisical?label=Follow" alt="Infisical Twitter" /> | ||
| </a> | ||
| </h4> | ||
|
|
||
| ## Introduction | ||
|
|
||
| **[Infisical](https://infisical.com)** is the open source secret management platform that teams use to centralize their secrets like API keys, database credentials, and configurations. | ||
|
|
||
| ## Documentation | ||
| You can find the documentation for the PHP SDK on our [SDK documentation page](https://infisical.com/docs/sdks/languages/php) | ||
|
|
||
| ## Security | ||
|
|
||
| Please do not file GitHub issues or post on our public forum for security vulnerabilities, as they are public! | ||
|
|
||
| Infisical takes security issues very seriously. If you have any concerns about Infisical or believe you have uncovered a vulnerability, please get in touch via the e-mail address security@infisical.com. In the message, try to provide a description of the issue and ideally a way of reproducing it. The security team will get back to you as soon as possible. | ||
|
|
||
| Note that this security address should be used only for undisclosed vulnerabilities. Please report any security problems to us before disclosing it publicly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| "name": "infisical/php-sdk", | ||
| "description": "Official PHP SDK for Infisical", | ||
| "type": "library", | ||
| "license": "MIT", | ||
| "authors": [ | ||
| { | ||
| "name": "Daniel Hougaard", | ||
| "email": "daniel@infisical.com" | ||
| } | ||
| ], | ||
| "require": { | ||
| "php": ">=8.1", | ||
| "guzzlehttp/guzzle": "^7.0", | ||
| "cuyz/valinor": "^1.0" | ||
| }, | ||
| "require-dev": { | ||
| "phpunit/phpunit": "^9.0", | ||
| "phpstan/phpstan": "^1.0", | ||
| "squizlabs/php_codesniffer": "^3.0" | ||
| }, | ||
| "autoload": { | ||
| "psr-4": { | ||
| "Infisical\\SDK\\": "src/" | ||
| } | ||
| }, | ||
| "autoload-dev": { | ||
| "psr-4": { | ||
| "Infisical\\SDK\\Tests\\": "tests/" | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "test": "phpunit", | ||
| "phpstan": "phpstan analyse src", | ||
| "cs": "phpcs src", | ||
| "cs-fix": "phpcbf src" | ||
| }, | ||
| "config": { | ||
| "sort-packages": true, | ||
| "optimize-autoloader": true | ||
| }, | ||
| "minimum-stability": "stable", | ||
| "prefer-stable": true | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| parameters: | ||
| level: 8 | ||
| paths: | ||
| - src | ||
| excludePaths: | ||
| - vendor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <phpunit | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" | ||
| bootstrap="vendor/autoload.php" | ||
| colors="true" | ||
| processIsolation="false" | ||
| stopOnFailure="false" | ||
| > | ||
| <testsuites> | ||
| <testsuite name="SDK Test Suite"> | ||
| <directory>tests</directory> | ||
| </testsuite> | ||
| </testsuites> | ||
| <coverage> | ||
| <include> | ||
| <directory suffix=".php">src</directory> | ||
| </include> | ||
| <exclude> | ||
| <directory>vendor</directory> | ||
| <directory>tests</directory> | ||
| </exclude> | ||
| </coverage> | ||
| <php> | ||
| <env name="APP_ENV" value="testing" /> | ||
| </php> | ||
| </phpunit> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.