Download the PHP package keboola/notification-api-php-client without Composer
On this page you can find all versions of the php package keboola/notification-api-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download keboola/notification-api-php-client
More information about keboola/notification-api-php-client
Files in keboola/notification-api-php-client
Package notification-api-php-client
Short Description Client for Notification API
License MIT
Informations about the package notification-api-php-client
Notification API PHP Client
PHP client for the Notification API (API docs).
Usage
The client uses two kinds of authorizations - Storage API token for Subscription API (SubscriptionClient
class) and
Manage API Application token with scope notifications:push-event
for the Events API (EventsClient
class).
or use a factory to create the client
Development
-
Create an Azure service principal to download the required images and login:
-
Login and check that you can pull the image:
-
Add the credentials to the k8s cluster:
-
Set the following environment variables in
set-env.sh
file (useset-env.template.sh
as sample):STORAGE_API_URL
- Keboola Connection URL to arbitrary stack where the notification service is registered.TEST_STORAGE_API_TOKEN
- Token to a test project.TEST_STORAGE_API_PROJECT_ID
- Project ID of the test project.TEST_MANAGE_API_APPLICATION_TOKEN
- Application token with scopenotifications:push-event
.
- Set one of Azure or AWS resources (or both, but only one is needed).
AWS Setup
- Create a user (
NotificationUser
) for local development using theprovisioning/aws.json
CF template.- Create AWS key for the created user.
- Set the following environment variables in
set-env.sh
file (useset-env.template.sh
as sample):TEST_AWS_ACCESS_KEY
- The created security credentials for theJobQueueApiPhpClient
user.TEST_AWS_SECRET_ACCESS_KEY
- The created security credentials for theJobQueueApiPhpClient
user.AWS_REGION
-Region
output of the above stack.AWS_LOGS_S3_BUCKET
-S3LogsBucket
output of the above stackk.
Azure Setup
-
Create a resource group:
-
Create a service principal:
-
Use the response to set values
TEST_AZURE_CLIENT_ID
,TEST_AZURE_CLIENT_SECRET
andTEST_AZURE_TENANT_ID
in theset-env.sh
file: -
Get ID of the service principal:
-
Deploy the Storage Account for logs, provide tenant ID, service principal ID and group ID from the previous commands:
- Get the connection string
Set the connection string and container name you provided as parameter to the create command to following environment variables in the set-env.sh
file:
- AZURE_LOGS_ABS_CONTAINER
- AZURE_LOGS_ABS_CONNECTION_STRING
Generate environment configuration
Store the result TEST_NOTIFICATION_API_URL
in set-env.sh
.
Run tests
-
With the above setup, you can run tests:
- To run tests with local code use:
License
MIT licensed, see LICENSE file.
All versions of notification-api-php-client with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^6.3|^7.2
myclabs/php-enum Version ^1.8
psr/log Version ^1.1
symfony/validator Version ^5.2|^6.0