Download the PHP package tigusigalpa/yandex-lockbox-php without Composer

On this page you can find all versions of the php package tigusigalpa/yandex-lockbox-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yandex-lockbox-php

Yandex Lockbox PHP SDK

Yandex Lockbox PHP SDK

πŸ‡·πŸ‡Ί Русская вСрсия Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π°Ρ†ΠΈΠΈ

Latest Version PHP Version License Tests

PHP/Laravel client library for Yandex Lockbox β€” a secure secrets storage service in Yandex Cloud.

Note: This package uses yandex-cloud-client-php for Yandex Cloud infrastructure management (authentication, organizations, clouds, folders).

πŸ“š Documentation

✨ Features

πŸ“¦ Installation

Development (path repository)

For mono-repo development, add to your root composer.json:

Then run:

βš™οΈ Configuration (Laravel)

Publish the configuration file:

Add environment variables to your .env:

πŸ” Authorization & API Connection Guide

Step 1: Getting OAuth Token

Documentation: OAuth Token Guide

Get token via OAuth request:

  1. Open the URL above in your browser
  2. Authorize the application
  3. Copy the OAuth token from the response URL (format: y0_..., y1_..., y2_..., y3_...)
  4. Add token to .env (Laravel):

Or pass directly to OAuthTokenProvider:

Step 2: Getting IAM Token (Optional)

Documentation: How to get IAM token

IAM token is generated automatically from OAuth token. But you can get it manually:

Alternative - using Yandex CLI:

⚠️ Note: IAM tokens expire after 12 hours

Step 3: Getting Cloud ID

Documentation: Retrieves the list of Cloud resources

List all clouds:

Or get first cloud directly:

Step 4: Getting Folder ID

Documentation: Retrieves the list of Folder resources in the specified cloud

List all folders in cloud:

Or get first folder directly:

Step 5: Add permissions to a folder

Documentation: Access management in Yandex Lockbox

You need to get Subject ID (user account ID that you want to assign permissions to) first

Documentation: Subjects that roles are assigned to

Documentation: Retrieves the list of Yandex Passport user accounts

Documentation: lockbox.editor

Documentation: Setting up folder access permissions

Step 6: Working with Yandex Lockbox API

Documentation: Lockbox API, REST: Secret

Now you can use the folder ID to work with secrets:

Handling Asynchronous Operations

Some Yandex Cloud operations (like assignRoleToFolder) are asynchronous and return an operation object with done=false. You have two options:

Option 1: Wait for completion automatically

Option 2: Poll operation status manually

Managing Folder Permissions

List and manage access bindings (permissions) for folders:

Response structure:

Laravel Facade

Laravel Artisan Commands

πŸ”’ Exception Handling

The library provides specific exceptions for different error types:

πŸ§ͺ Testing

Artisan Commands

lockbox:test - Comprehensive Testing

Runs complete test suite with 8 tests:

Output:

lockbox:list - List Secrets

lockbox:show - Show Secret Details

lockbox:create - Create Secret

lockbox:add-version - Add Version

JSON file format:

lockbox:delete - Delete Secret

Common Testing Scenarios

Scenario 1: First Run

Scenario 2: Create New Secret

Scenario 3: Update Secret

PHPUnit Tests

πŸ“š API Reference

OAuthTokenManager Methods

Authentication & Token Management

Folder Management

Access Control (Permissions)

- assignRoleToFolder(string $iamToken, string $folderId, string $subjectId, string $role = 'lockbox.editor', string $subjectType = 'userAccount', bool $waitForCompletion = false, int $maxWaitSeconds = 60): array - Assign role to folder

listFolderAccessBindings(string $iamToken, string $folderId, int $pageSize = 100, ?string $pageToken = null): array - List folder access bindings (paginated)

User Management

Async Operations

- waitForOperation(string $iamToken, string $operationId, int $maxWaitSeconds = 60, int $pollIntervalSeconds = 2): array - Wait for operation to complete

Client Methods

Secret Management

Version Management

πŸ“ Requirements

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This package is open-sourced software licensed under the MIT license.

πŸ‘€ Author

Igor Sazonov

πŸ”— Links


All versions of yandex-lockbox-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
guzzlehttp/guzzle Version ^7.0 | ^8.0
psr/log Version ^1.0 | ^2.0 | ^3.0
tigusigalpa/yandex-cloud-client-php Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tigusigalpa/yandex-lockbox-php contains the following files

Loading the files please wait ...