stellarsecurity/stellarsecurity-vpn-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stellarsecurity/stellarsecurity-vpn-laravel

最新稳定版本:1.0.1

Composer 安装命令:

composer require stellarsecurity/stellarsecurity-vpn-laravel

包简介

Enterprise SDK for Stellar VPN integration.

README 文档

README

This package provides a Laravel-friendly SDK for integrating with the Stellar VPN backend from any Stellar UI API service.

Installation

Add the package to your project (after publishing it to your chosen package registry):

composer require stellarsecurity/stellarsecurity-laravel-vpn

If you are not using Laravel package auto-discovery, register the service provider manually in config/app.php:

'providers' => [
    // ...
    StellarSecurity\LaravelVpn\StellarVpnServiceProvider::class,
];

Configuration

Publish the configuration file:

php artisan vendor:publish --tag=stellar-vpn-config

This will create config/stellar_vpn.php.

Environment variables used:

STELLAR_VPN_BASE_URL=https://stellarvpnapiprod.azurewebsites.net/api
STELLAR_VPN_USERNAME=StellarVpnApiProd
STELLAR_VPN_PASSWORD=your-strong-password-here
STELLAR_VPN_TIMEOUT=10

Note: Set the username and password to the Basic Auth credentials used by the Stellar VPN API.

Available Methods

All core operations are exposed through StellarSecurity\LaravelVpn\Services\VpnServerClient.

You can type-hint it in your controllers or services and let Laravel inject it:

use StellarSecurity\LaravelVpn\Services\VpnServerClient;

class VpnController
{
    public function __construct(private VpnServerClient $client) {}

    public function servers()
    {
        $servers = $client->listServers();

        return response()->json($servers);
    }
}

1. List VPN Servers

$servers = $client->listServers();
  • Calls: GET /v1/vpnservercontroller/list
  • Returns: array of server entries, e.g.:
[
    [
        'id'            => 'eu-1',
        'name'          => 'Switzerland – Zurich',
        'country'       => 'CH',
        'lat'           => 47.3769,
        'lon'           => 8.5417,
        'protocols'     => ['udp', 'tcp'],
        'hostname'      => 'ch-zurich-1.stellarsecurity.com',
        'config_url'    => 'https://cdn.stellarsecurity.com/ovpn/eu-1.ovpn',
        'config_sha256' => '...',
    ],
    // ...
]

2. Issue or Fetch VPN Credentials

$payload = $client->issueCredentials($userId, $deviceId);
  • Calls: POST /v1/vpncredentialcontroller/credentials
  • Body:
[
    'user_id'   => 123,
    'device_id' => 'some-device-id',
]
  • Returns a response array from the API, typically:
[
    'response_code'    => 200,
    'response_message' => 'OK',
    'data'             => [
        'username' => 'stvpn_xxx',
        'password' => 'plain_random_password_or_null',
    ],
]

3. Revoke Credentials for a Single Device

$success = $client->resetDevice($userId, $deviceId);
  • Calls: POST /v1/vpncredentialcontroller/reset
  • Returns: true if response_code === 200, otherwise false.

4. Revoke ALL Credentials for a User

$success = $client->resetAll($userId);
  • Calls: POST /v1/vpncredentialcontroller/reset-all
  • Returns: true if response_code === 200, otherwise false.

Example Controller

use StellarSecurity\LaravelVpn\Services\VpnServerClient;

class StellarVpnController
{
    public function __construct(private VpnServerClient $vpnClient) {}

    public function serverList()
    {
        return response()->json($this->vpnClient->listServers());
    }

    public function credentials()
    {
        $userId   = auth()->id();
        $deviceId = request()->input('device_id');

        $response = $this->vpnClient->issueCredentials($userId, $deviceId);

        return response()->json($response);
    }
}

Notes

  • All calls use HTTP Basic Auth against the Stellar VPN API.
  • Errors from the remote API should be handled at the UI API level (e.g. logging, retries, custom HTTP responses).

统计信息

  • 总下载量: 120
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2025-12-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固