Custom key URI support for AES-128 encryption in google cloud transcoder - google-cloud-transcoder

Not able to create a HLD stream with AES 128 encryption based on the public document
Issue Summary: Customer is looking at using our transcoding API to provide DRM capabilities to one of their learning platform. They require HLS and DASH with AES 128 bit encryption . I have followed the public documentation but not getting the m3u8 or TS files . The job created from 'preset/web-hd' is working correctly.
Please help me by providing exact sample codes for the above scenario. Please provide with complete code required for HLS and DASh with AES 128 bit encryption.
Project Number: project-number
Job ID: job-id
Location:
Job Config elementaryStreams: [ { key: 'video-stream1', videoStream: { codec: 'h264', heightPixels: 720, widthPixels: 1280, bitrateBps: 2500000, frameRate: 60, }, }, ], muxStreams: [ { "key": "360p-my-video-ts", "fileName": "360p-my-video.ts", "container": "ts", "elementaryStreams": [ "video-stream1" ], "encryption": { "key": "aabbccddeeff11223344556677889900", "iv": "00112233445566778899aabbccddeeff", "sampleAes": { "keyUri": "skd://00112233445566778899aabbccddeeff" }

I think you miss the "manifest" section on the bottom of the "configure-drm" link.
Also please refer to https://cloud.google.com/transcoder/docs/how-to/configure-drm (there are some samples)
The Transcoder API is mostly focused on supporting DRM systems, when you use your own key you have to specify full path to the key, unfortunately do to some validation in our API it is not possible right now, we will work on allowing custom URLs.
We have a fix ready (this will allow customers to specify key URIs with HTTP protocol as well), but it will take a few weeks to roll out to Prod. If you want to try it out right now you can generate the manifest with sdk:// URI in it and replace it with the HTTP link to the key in the manifest, but I'd suggest to wait until the fix is available in Prod.
In the meantime here are some issues with your config:
The decryption key should be in binary rather than plain text
In the job config you are using Sample-AES encryption that is supposed to be used with Fairplay, you should use AES-128 instead

Related

Best way to send xml from iot device to azure iot hub?

I have an energy monitor that can only output xml data via http post. I am looking to send this data to an azure-iot hub for processing and storage. What is the best way to send xml data to from several of these devices to the hub? I have looked at various gateways but havent found a simple, scalable, cost effective way to do this. I am open to having some sort of intermediary but they all introduce a layer of complexity to simply sending the data to the hub.
Your energy monitor can publish a telemetry data direct to the Azure IoT Hub using a HTTPs protocol.
The following is an example:
and the body:
and the Device Explorer output:
and the blob Storage:
{
"EnqueuedTimeUtc": "2019-09-25T15:58:25.0900000Z",
"Properties": {
"abcd": "abcd1234"
},
"SystemProperties": {
"connectionDeviceId": "device2",
"connectionAuthMethod": "{\"scope\":\"device\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",
"connectionDeviceGenerationId": "636842109368955167",
"contentType": "application/xml",
"contentEncoding": "",
"enqueuedTime": "2019-09-25T15:58:25.0900000Z"
},
"Body": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4gDQo8UGFyYUluZm8gPg0KICA8TmFtZT5Wb2x0YWdlPC9OYW1lPg0KICA8Q29kZT5VczwvQ29kZT4NCiAgPFVuaXQ+VjwvVW5pdCA+DQogIDxGcmVxPjQwPC9GcmVxID4NCiAgPFN0YXJ0PjA8L1N0YXJ0Pg0KICA8RW5kPjI4OS41PC9FbmQ+DQo8L1BhcmFJbmZvPg0K"
}
Note, that the body is a Base64 encoded xml text:

Documenting error codes definition in Swagger API contract

Imagine you are working under following circumstances:
You have REST API modules with API documentation generated into swagger-ui.html
Possible HTTP status codes for endpoints are documented well via io.swagger.annotations.* on controller method level for each endpoint.
In case of some error state (4XX or 5XX) application replies with ErrorResponseDTO with structure like
"ErrorResponseDTO": {
"type": "object",
"properties": {
"errorCode": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
Application have tens of errorCodes (within range like 1 - XX and please consider them as a legacy definiton without an easy way to change them).
List of errorCodes is relevant for the whole application so you prefer to keep their definiton list/table in overall API documentation rather then maintaining errorCodes definiton for each API endpoint separately.
Now you are looking for an effective way how to document these application error codes into API contract.
The approach of including a list of errorCodes with codes description into generated swagger-ui.html seems like a better way to keep API documentation up to date instead of having static and handwritten codes definition table attached in Markdown format in some Readme file.
Would you please have any recommendation how to document various codes which your applications produce?
Do you follow some specific good practice in this topic?
Thank you in advance.
Meanwhile within a small internal dev team and with frequent API extensions there can be used generated swagger-ui with included error codes:
#Bean
public Docket swaggerSettings() {
ApiSelectorBuilder builder = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(
new ApiInfoBuilder()
.title("Response errorCodes table")
.description(RestResponse.generateErrorsDocumentation().toString())
.build()
)
...
.select();
return builder.apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
.paths(PathSelectors.any())
.build()
.useDefaultResponseMessages(false);
}

Album mbId in track's metadata

I am using MusicBrainz to get a track's meta data. I want to get the track's album's mbid. I am doing the following lookup using ISRC code.
https://musicbrainz.org/ws/2/isrc/USRC11600201?fmt=json
But in response I don't get any metadata related to the album of the track. I get the following response:
{
"isrc": "USRC11600201",
"recordings": [
{
"disambiguation": "single remix",
"title": "Cheap Thrills",
"id": "92e27a47-3546-4bc2-a9f7-b19e43d7a531",
"length": 223000,
"video": false
},
{
"length": 218540,
"video": false,
"title": "Cheap Thrills",
"disambiguation": "",
"id": "5845e975-33b4-4b0d-8e74-8f57d128b3d1"
}
]
}
I have tried various combinations of the "inc" sub query parameter as well but nothing works. Please help me out. I am really stuck at this.
Using inc=releases in the URL parameters should be enough to get you the information that you want. However, it seems like there's a bug with MusicBrainz's JSON web service (which is still officially in beta), as you can see in the difference between the XML and JSON end points' output:
https://musicbrainz.org/ws/2/isrc/USRC11600201?inc=releases&fmt=json (JSON) vs. https://musicbrainz.org/ws/2/isrc/USRC11600201?inc=releases (XML).
One obvious solution/work-around here would be to switch to using the more mature XML endpoint. If that is not an option, you can use the Recording MBIDs given in the JSON output to look up releases associated with those Recordings, e.g., https://musicbrainz.org/ws/2/recording/5845e975-33b4-4b0d-8e74-8f57d128b3d1?inc=releases&fmt=json (note that inc=releases is also needed here to get the information about the releases, and it actually works when looking up recordings).
So to get the details of the album of a track when I have the ISRC of the track, we need to do the following get request:
https://musicbrainz.org/ws/2/isrc/GBUM71604605?inc=releases
It will give a response in xml. The xml api is more stable click for more details on this
As I need the response in json, we can use a library like xml to json and vice-versa library
As much as I have seen the xml response from the MusicBrainz api is more accurate and gives a lot of information.

How to send a device management request using NodeRed or any REST client

I am trying to sent a DM firmware update command from a NodeRed Flow.
Function node:
msg.payload = {"MgmtInitiationRequest": {
"action":"firmware/update",
"devices": [{
"typeId": "myType",
"deviceId": "myDevice"
}]
}}
msg.headers={"Content-Type":"application/json"}
return msg;
I send it to a http request node with a POST to
https://orgid.internetofthings.ibmcloud.com/api/v0002/mgmt/requests
Basic Authentication with api keys. I based it of Initiate a device management request
I get back a 403 which the docs have as:
One or more of the devices does not support the requested action
Anyone see what I'm missing? It works fine from the IoT Platform UI to the same devicetype/deviceid.
EDIT: Same 403 if I use a Rest client like Postman.
The swagger API documentation is a little bit misleading in that the 'body' parameter is given a name.
But, like the other POST APIs, that name isn't actually included anywhere as part of the payload.
The payload should just look like this:
{
"action": "firmware/update",
"devices": [
{
"typeId": "string",
"deviceId": "string"
}
]
}
This page in the documentation provides more detail:
https://console.ng.bluemix.net/docs/services/IoT/devices/device_mgmt/requests.html#firmware-actions-update
Has your appliance published the set of supported commands it supports when it announced itself as a managed device?
A device connects to the Watson IoT Platform and uses the managed devices operation to become a managed device.
Which looks something like this
Topic: iotdevice-1/mgmt/manage
{
...
"supports": {
"deviceActions": true,
"firmwareActions": boolean
},
...
},
...
}
https://console.ng.bluemix.net/docs/services/IoT/devices/device_mgmt/index.html

Get Recommendation from LinkedIn API returns empty map [:] as response

I have created a web application from which I am trying to get recommendations of a user from his/her LinkedIn Profile using URL
String url="https://api.linkedin.com/v1/people/~:(recommendations-received:(id,recommendation-type,recommendation-text,recommender))?format=json"
When I am using this URL in the
Api Explorer it works fine. And gives output:-
{ "recommendationsReceived": {
"_total": 2,
"values": [
{
"id": 558598601,
"recommendationText": "xxx is among the best team players I ever worked with. He has handled client effectively with smooth operations. I had always seen him as person with solution mindset and always look for solution rather than thinking about the problem. ",
"recommendationType": {
"code": "colleague"
},
"recommender": {
"firstName": "XXX",
"id": "YYYY",
"lastName": "XXX"
}
},
{
"id": ZZZZ,
"recommendationText": "XXX is one of the most dedicated person at work.I always him with a flexible attitude and ready to adapt himself in all situation.I have seen him work all night to catch up all the deadlines and deliver on time ."
"recommendationType": {
"code": "colleague"
},
"recommender": {
"firstName": "XXX",
"id": "YYYY",
"lastName": "XXXX"
}
}
] } }
The problem comes, when I am using this URL in my Developer app.It doesn't give any error just simple return an empty map [:] as output in response
Irrespective of these recommendation fields, I successfully get the user basic profile data such as email, id, image,firstName,lastName.Means my code is working for other fields well but not for these recommendation fields*
To find the solution, I did some internet surfing and find a link of Linked API docs
Linked API Docs
As per Docs following selection of profile fields are only available
to applications that have applied and been approved for the Apply with
LinkedIn program:
Recommendation Fields
I already created a LinkedIn Developer account to get key & Secret
So how do I apply and get approval for Apply with LinkedIn Recommendation Fields.
I already have seen the LinkedIn support but can't find the way to ask question to the Linked Developer help support
Please suggest me the right way.
After a long internet surfing,I have found something fruitful that, I have to fill up a form to get these fields.Here is the form
along with its procedural details
You can use just recommendations-received keyword. Try the following link. I am getting all recommendations details with this link.
https://api.linkedin.com/v1/people/~:(recommendations-received)?format=json

Resources