Intercept data from post request with api platform - api

It's my first post here: after hours of research on web I decided to ask here if someone have the answer.
-> I m working on a symfony app and I have just started using api platform and would like to know if it is possible (I guess so) to "intercept" post requests to process their content. I would like to be able to compare the contents of a table with the contents of the query. The final goal is to be able to authenticate devices if their activation code is in the table in question.
Hope this is understandable ...
Thank you in advance :)

Yes, it’s possible Api platform have some events and you can listen one of them see https://api-platform.com/docs/core/events/
In your case I will listen POST_DESERIALIZE

Related

How to authenticate docker hub api request?

I have been trying for the past several hours to make an authenticated request to the docker hub api. First of all, let me say that their documentation is very unclear. There are several different subdomains that you have to cycle through. The ones I have seen are index.dockerhub.io, registry-1.docker.io/v1/ auth.docker.com/token. There were others. But you get the point. Its like their api is managed by 30 different people or something and they forgot to have a meeting about how to unify their api. It feels like I have read just about everything I could find on the internet about how to do what I am trying to do, and it still is very unclear to me what I am supposed to do.
Their documentation states that I am supposed to get an auth token before making certain request. Ok. Fine. How do I do that? I got lucky and stumbled across the endpoint, https://auth.docker.io/v2/token/ no thanks to their api. I found it by just guessing. I don't know that version 2 is capable of even doing what I am trying to do.
What steps do I need to take to make authenticated request to the dockerhub api. What I am trying to do more specifically, is I am trying to query information about the given images that are on the hub, like the size of the images, and the basic port information that is available. I know its possible, because I have used services that do it. So, how do you properly authenticate request to get this information?
So after a few more hours of working on this problem, I came across someone who had similar issues and wrote a blog post about exactly how to solve it. The short answer is the endpoint that was missing from the docker api documentation is https://cdn-registry-1.docker.io/v1/. Why didn't they document their api better? I don't know. If anyone wants to read the full article about how this is done, you can find it at http://www.appcontainers.com/requesting-image-information-using-the-public-docker-api/
This was the most helpful article I have found on the subject. Hopefully this will help some other poor soul who is trapped in the confusion known as the docker api.

Notification on Feeds URL

I am .net developer.I need some clarification in the feeds notification.
I have some list of RSS feed url (e.g more than 100 URL).
My question is I want to develop a console application to get notification if the new item comes in any of the 100 URLS.
What is exact way to do this. Please guide me.
Can we make use of the pubsubhub protocol for this requirement or any other simple approach is available to do this.
Thanks,
Jayakumar
Yes, PubSubHubbub is a protocol that you could use for this. Now, it's not implemented by all feeds out there, so you'll have to resort to polling. Another option is to use services like Superfeedr which provide a webhook mechanism to notify your application when a feed has been updated.

Xcode - Web services and my confusion

I am having a problem here. I am totally new to this concept of servers and web services and being able to get data uploaded and retrieved on different devices, but I want to learn it, say if I want to create an app like Instagram.
But that is EXACTLY what I dont want, a link to a long tutorial on the internet on how to create the most complex app ever, I want to start slow. After doing extensive power searches on Amazon there are basically no books that will help me. So I want to start slow, here is my goal:
Get a great understanding of how web service backends and servers work and be able to apply it in other app ideas I have and want to start developing
I would like to start by being able to create an app that allows a user to enter some text into a field, it uploads to the server, another device can press a button to retrieve the text and display it in a text view.
I do not know php, and every single tutorial I have entered on this website is literal mindeff, the reason for this is because everyone has a different solution, sync web service backend with Core Data, MySQL, parse, Rails and it truly overwhelms me because I do not know which one to pick! And even worse some people provide code but I have no understanding whatsoever, and its like looking at a totally new language!
I am not asking for code, in fact that is the exact opposite. I am asking for someone to really lay out their knowledge, how does it all work? What is the best tool? Some resources and links. Nothing too complex...
I hope you can truly understand my extreme confusion and frustration. I think the reason might be is I might not be ready yet for all this, but I want to push forward and carry out my app idea!
Thank you...
Update:
I have finally decided on a web service I would like to use, it is the Amazon S3 web service, I am still not fully comprehending the full process though, any help or ideas!?
Since you wanted to create an Instagram-type app, look at this: http://www.raywenderlich.com/13511/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-12
This is a good link to servers: http://www.youtube.com/playlist?list=PLC71D7CFB6AF935E6&feature=plcp. Watch the list to get an understanding of servers.
Maybe you want to read up on sql. Understanding sql will help.. Again: http://www.youtube.com/course?list=EC32BC9C878BA72085&feature=plcp. Watch the list to get an understanding of sql...
I can pass you the link and you got to do the work....
Hope this helps...

Creating Chat function in iOS - Through continuous request

I was tasked to create a Chat function for our app in iOS. I found this tutorial which creates a Chat app from scratch.
http://www.ibm.com/developerworks/library/x-ioschat/index.html
The link above is very helpful, but there is a small problem. In the app, a request will be made every 5 seconds to look for new responses. One of my colleagues said that it is not advisable to make a request to the server every now and then.
So I decided to look for other alternatives. I learned about long-polling through this link.
From what I understood, once a request was made the server will "hold" the request until something interesting comes up. Does this mean that once a response was thrown to the user, the request ends? If that's true, this means that a request will be made every now and then as well, right?
If that's the case, can anyone tell me what's the best way to implement a chat function in iOS?
My friend showed me a AJAX JavaScript code (I just found out that he also used a plug-in, which I am not familiar with) where a single continuous request was made, and this request doesn't end even if a response was already thrown to the user. Is there a way to do this in iOS?
It is not a good approach to make http ajax request to send and receive chat. A chat response should be displayed at the moment when the other user press "Send". We cant ask for the users to wait 1 second to fetch if there any new responses.
You must use a chat server to accomplish this. I hope the following url would be helpful. I just wanted to give you the Idea of using a Chat Server.
http://wiki.remobjects.com/wiki/SuperHTTP_Chat_(iOS)Sample(Xcode)

Objective-c web form based authentication

So I am working on an iPad app that needs to talk to our company server to pull in some XML. In a browser, when the user tries to first navigate to the site, they are redirected to an SSO form that generates a cookie that is saved.
Now my application may need to replicate this behavior and generate the cookie so we can pull xml data off various parts of the site. I have never done anything like this before and there is very little documentation on the web so I am really looking for some general guidance. So far I have tried doing something like this, here.
That works to return the web form, but where to go from there eludes me. Does anyone have any ideas they would like to throw out? Essentially all that I need to do right now is authenticate the user's credentials, and save that verification. If there is an easier way to do that based on this template, I would definitely be open to suggestions. Any help at all would be greatly appreciated.
What i use for a lot of my networking is ASIHTTPRequest it is an API that is available, instead of trying to use low level sockets or the Apple APIs, with a decent guide and an active Google Group for questions. It can certainly handle xml requests as well as authentication. Here is a link to the site, ASIHTTPRequest