Can you set an Application's Client Secret using a kickstart file? FusionAuth - fusionauth

I am using a kickstart.json file to setup FusionAuth in developer environments. Everything is automated except I still need to manually go and get the client secret from the fusion auth instance.
Is there anyway I can predefine the client secret in the kickstart file so I can pre-configure it in my app?

you should absolutely be able to set the client secret from kickstart.json. Any API call should work from within Kickstart.
https://fusionauth.io/docs/v1/tech/apis/applications#create-an-application indicates you can POST an application including the client secret.
So a kickstart file like this should work:
{
"variables": {
"defaultTenantId": "30663132-6464-6665-3032-326466613934"
},
"apiKeys": [
{
"key": "mykey",
"description": "API key"
}
],
"requests": [
{
"method": "POST",
"url": "/api/application/85a03867-dccf-4882-adde-1a79aeec50df",
"body": {
"application": {
"name": "Pied Piper",
"roles": [
{
"name": "dev"
},
{
"name": "ceo"
},
{
"name": "intern"
}
],
"oauthConfiguration" : {
"clientSecret": "shhh-your-desired-secret"
}
}
}
}
]
}
I haven't tested that, but don't see any reason why it would not work. (Note that 1.37, the most recent version, has an issue with kickstart as documented here: https://github.com/FusionAuth/fusionauth-issues/issues/1816 but that should be fixed soon.)
If this doesn't work for you, please share the error message and a scrubbed kickstart file.

Related

Agora cloud recording is not saving file in S3 when streaming from android

I have already viewed this question
I followed the procedure, first called acquire then start then stop
I followed the procedure , first called acquire then start then stop
Here is my acquire call
https://api.agora.io/v1/apps/{{APPID}}/cloud_recording/acquire
Request body
{
"cname": "{{AccessChannel}}",
"uid": "{{RecordingUID}}",
"clientRequest":{
}
}
The response
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfzZ8g-RNe4wP9vsFnBhU785sHbxN0_dI8MVBqLWrCy7TCUo4U3XXne-2hA7expaSg-NgpZ5PcnFK-IrNSvmFNJqL4PGS9hw2q7lDYEtJH_0VgBG4Qdsg2TofWuF2DW7IMAt8NYBp9Hh_06d1K3pIcMJFPUWvfV7fInPDrecYuDmZdiRS9AYydjQlHa6jb51S0sKXzTVYELCJZAXP-ALS_whAh_ojFeltKLKzOC9iYodyAAwq4QnclbL3LKvBeVtCEfS9WjyYzyHDhCngJ-JrIwW"
}
Then I call start
URL : https://api.agora.io/v1/apps/{{APPID}}/cloud_recording/resourceid/{{resourceId}}/mode/mix/start
Body:
{
"cname":"{{AccessChannel}}",
"uid":"{{RecordingUID}}",
"clientRequest":{
"recordingConfig":{
"maxIdleTime":300,
"streamTypes":2,
"channelType":1,
"videoStreamType":0,
"transcodingConfig":{
"height":640,
"width":360,
"bitrate":500,
"fps":15,
"mixedVideoLayout":1,
"backgroundColor":"#FF0000"
},
"subscribeVideoUids":[
"123",
"456"
],
"subscribeAudioUids":[
"123",
"456"
],
"subscribeUidGroup":0
},
"storageConfig":{
"vendor":1,
"region":0,
"bucket":"{{Bucket}}",
"accessKey":"{{AccessKey}}",
"secretKey":"{{SecretKey}}",
"fileNamePrefix":[
"directory1",
"directory2"
]
},
"recordingFileConfig":{
"avFileType":[
"hls"
]
}
}
}
Response
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfzZ8g-RNe4wP9vsFnBhU785sHbxN0_dI8MVBqLWrCy7TCUo4U3XXne-2hA7expaSg-NgpZ5PcnFK-IrNSvmFNJqL4PGS9hw2q7lDYEtJH_0VgBG4Qdsg2TofWuF2DW7IMAt8NYBp9Hh_06d1K3pIcMJFPUWvfV7fInPDrecYuDmZdiRS9AYydjQlHa6jb51S0sKXzTVYELCJZAXP-ALS_whAh_ojFeltKLKzOC9iYodyAAwq4QnclbL3LKvBeVtCEfS9WjyYzyHDhCngJ-JrIwW",
"sid": "6068aec4fd4fc47b623bceaf1f2c8f6b"
}
And finally I called stop
URL: https://api.agora.io/v1/apps/{{APPID}}/cloud_recording/resourceid/{{resourceId}}/sid/{{sid}}/mode/mix/stop
Body:
{
"cname": "{{AccessChannel}}",
"uid": "{{RecordingUID}}",
"clientRequest": {}
}
And the response is
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfzZ8g-RNe4wP9vsFnBhU785sHbxN0_dI8MVBqLWrCy7TCUo4U3XXne-2hA7expaSg-NgpZ5PcnFK-IrNSvmFNJqL4PGS9hw2q7lDYEtJH_0VgBG4Qdsg2TofWuF2DW7IMAt8NYBp9Hh_06d1K3pIcMJFPUWvfV7fInPDrecYuDmZdiRS9AYydjQlHa6jb51S0sKXzTVYELCJZAXP-ALS_whAh_ojFeltKLKzOC9iYodyAAwq4QnclbL3LKvBeVtCEfS9WjyYzyHDhCngJ-JrIwW",
"sid": "6068aec4fd4fc47b623bceaf1f2c8f6b",
"code": 435
}
I am not sure what did I do wrong ?
My streaming is running on a android device , only one broadcaster no audience
And I called the API from postman
I have double checked every parameter
Please make sure you are passing the authentication token in the request body of start API.
Here is sample
{
"cname":"{{AccessChannel}}",
"uid":"{{RecordingUID}}",
"clientRequest":{
"token": "<place token here>",
"recordingConfig":{
"maxIdleTime":300,
"streamTypes":2,
"channelType":1,
"videoStreamType":0,
"transcodingConfig":{
"height":640,
"width":360,
"bitrate":500,
"fps":15,
"mixedVideoLayout":1,
"backgroundColor":"#FF0000"
},
"subscribeVideoUids":[
"123",
"456"
],
"subscribeAudioUids":[
"123",
"456"
],
"subscribeUidGroup":0
},
"storageConfig":{
"vendor":1,
"region":0,
"bucket":"{{Bucket}}",
"accessKey":"{{AccessKey}}",
"secretKey":"{{SecretKey}}",
"fileNamePrefix":[
"directory1",
"directory2"
]
},
"recordingFileConfig":{
"avFileType":[
"hls"
]
}
}
}

Chaostoolkit istio extension hangs when playing experiment

I'm trying to use the chaos toolkit istio extension, my problem is as follows:
I have a experiment.json file which contains a single probe to retrieve a virtual service. The file looks similar to the following:
{
"version": "1.0.0",
"title": "test",
"description": "N/A",
"tags": []
"secrets": {
"istio": {
"KUBERNETES_CONTEXT": {
"type": "env",
"key": "KUBERNETES_CONTEXT"
}
}
},
"method": [
{
"type": "probe",
"name": get_virtual_service:,
"provider": {
"type": "python",
"module": "chaosistio.fault.probes",
"func": "get_virtual_service",
"arguments": {
"virtual_service_name": "test"
"ns": "test-ns"
}
}
}
}
I have set KUBERNETES_CONTEXT and http/https proxy as env vars. My authorisation is using $HOME/.kube/config.
When playing the experiment it validates the file fine and tries to perform the action but becomes stuck and just hangs until it times out.
The error I see in the logs is a HTTPSConnectionPool error (failed to establish a new connection, operation timed out).
Am I missing any settings? All help appreciated.

How to Consume Kafka Topic from ZeroCode Framework

I want to consume one kafka topic via ZeroCode framework. I can consume my localhost kafka server from ZeroCode scenario. Also I can consume the topic that is got from my actual remote kafka server with using kafka-consumer.bat via command line but I can not consume same topic from ZeroCode.
What Do I need to add special configuration?
{
"name": "Consume Message From doob-ship-topic",
"url": "kafka-topic:my-sample-topic",
"operation": "consume",
"request": {
"consumerLocalConfigs": {
"recordType": "JSON",
"commitSync": false,
"showRecordsConsumed": true,
"maxNoOfRetryPollsOrTimeouts": 3
}
},
"assertions": {
"size": 1,
"records": [
{
"value": {
"key": "99930000000000260001"
}
}
]
}
}
I tried different configurations but I didn't handle with that.
I solved.
"consumerLocalConfigs": {
"recordType": "RAW",
"commitSync": true,
"showRecordsConsumed": true,
"maxNoOfRetryPollsOrTimeouts": 2,
"pollingTime": 1595 // I added this.
}
Added pollingTime is solved my problem.

Composer asks only for password with private repository

When I use a private repository like below in my composer.json
"repositories": [
{
"url": "ssh://repo.com/porject",
"type": "git"
}
],
Composer install/update doesn't ask me for my username, it gets the name of the current user of my computer and uses it automatically. It prompts me only for a password.
Any idea how to set it correctly and how I can store the auth once typed in?
Try to config access via SSH keys or specify your desired username like below. For more information see the Composer docs.
{
"repositories": [
{
"type": "composer",
"url": "ssh2.sftp://example.org",
"options": {
"ssh2": {
"username": "composer",
"pubkey_file": "/home/composer/.ssh/id_rsa.pub",
"privkey_file": "/home/composer/.ssh/id_rsa"
}
}
}
]
}

composer / satis svn repository http basic authentication

I am trying to create a composer package repository for my company using satis.
My svn repositories are acessed via http (apache svn).
I am trying to add this to my config.json of satis
{
"name": "packages",
"homepage": "http://packages.example.org",
"repositories": [
{ "type": "svn",
"url": "myrepourl"
}
],
"require-all": true
}
THe problem is that I cant authenticate in the repository:
Repository could not be processed, svn: OPTIONS of authorization failed. basic authentication rejected.
How can I pass the username/password to satis?.
Thank you
According to composer documentation, you have to put your user key files or your certificate in your project, not in the satis configuration :
Using SSH :
{
"repositories": [
{
"type": "composer",
"url": "ssh2.sftp://example.org",
"options": {
"ssh2": {
"username": "composer",
"pubkey_file": "/home/composer/.ssh/id_rsa.pub",
"privkey_file": "/home/composer/.ssh/id_rsa"
}
}
}
]
}
Using Certificate :
{
"repositories": [
{
"type": "composer",
"url": "https://example.org",
"options": {
"ssl": {
"cert_file": "/home/composer/.ssl/composer.pem",
}
}
}
]
}