Proper auth method against keystone ( openstack ) - authentication

Should I directly query the API or rely on importing methods from the keystone client?
Thoughts?

It kind of depends on your requirements as to how you want to interact with keystone.
If you're querying the API directly then you're probably using curl in a bash script or from the command line. This can be particularly useful if you're working with bleeding edge keystone API code from trunk that doesn't even have methods in the keystone client yet.
If you're importing methods from the keystone client you're probably writing a python script or application. This is the better option if you're working with stable keystone code from a stable branch or package. The keystone client is just easier to work with rather than raw HTTP requests.
HTH

It's easier to use the keystone client methods. The python-keystoneclient package has documentation on how to do this in the doc directory. For example, see The client API.

I ended up using the python-keystoneclient bindings for initial authentication but for any query outside the scope of the keystoneclient API I simply referenced the auth_token and called to requests for direct API queries against the keystone ec2 url with the token in the header.
This worked well enough. Keystone needs work.

Related

Postman Automated Collection Generation

has anyone done an enterprise integration of their public API with Postman? Checking Postman pages it seems like everything is straightforward, however, I have some concerns:
I don't see the way to automatically install pre-request scripts. Pre-request scripts allow an easy and straightforward way to call the endpoints without going through authentication step manually.
If you use sync with Github you'll need to give Postman full access. Not sure how people work around that.
You need to convert swagger to postman definition. Default Postman has limited nested levels of API schema, which means your API documentation will need additional processing step
So I don't know if it's worth integrating API release to the Postman with the internal API management system, or rather have a simple script on a virtual machine.

Is there a way to proxy api calls in production

I have a vue.js frontend and I need to make api calls to an external api which doesn't allow cross-origin.
Is there a way to proxy this in the vue frontend, in development I used a devServer proxy and this worked. I could always forward it through my own spring backend but this seems like a worse solution then just proxy in the fontend.
You can't do it in production, proxy through bachend server seems right solution for you.
Also you can do a lot of stuff, like caching answers from external api, working with data immediately, without additional frontend work. Just try to do it.
If i were you, i'd just create/add separate service on backend that should work with that api.

Is there a possibility to use gRPC in Nuxt.js?

Im using Nuxt.js to build a frontend for some data I pull from a REST API. Now I need to call functions on a remote service, ideally via gRPC since the service has a endpoint for that.
I searched the web but I guess Im misunderstanding the whole process of creating a frontend with nuxt, since I cant find any information on that topic.
How can I, for example embed the solution provided here: https://github.com/grpc/grpc-node into my frontend?
nuxt is frontend. and the lib you are linked for backend. Nuxt dont care how you get your date, e.g. grpc or rest or anything. You need to use grpc javacsript client that work in browser e.g. https://github.com/grpc/grpc-web

Could GraphQL be useful for a system without a frontend client?

So far all the guides i have looked at involve communicating with a frontend client via Graphql, I wonder does it have any usage for something purely backend, such as communicating among microservices?
You can certainly make a request to the API from another server as well. Just as you can make a call to any REST endpoint from anywhere, you can perform server to server communication with GraphQL APIs as well.
For example, at Scaphold, we use Lambda for many webhooks and scheduled tasks. And from our microservice, we use the request library to make POST requests to the Scaphold server's GraphQL API.
Here's an example of a create mutation that you can use from a Node server.
Hope this helps!

how to consume meteor API call

I need to write a Java web application to call a function Meteor APP. One way is through API call. Are there any other means to call Meteor function from 3rd party application.
Thanks
Murali
It all depends on what your requirements are, how your Meteor app is structured, and what sort of integration you desire.
If you are wanting your Java web application to be able to natively call Meteor methods or subscribe to publications, then you will have to use a Java DDP Client to do this. Fortunately, there is at least one documented Java DDP client that you can use for this (and probably many others out there is you search). For your reference, here is a compiled list of DDP clients for other languages/technologies.
If on the other hand you don't want to interface with you meteor app using DDP, then you could always implement a REST API in your meteor app. There are several packages available to do this, but I would highly recommend the simple:rest package.
This package automatically creates a REST API for all your existing publications and methods without any extra code (just simply add the package to your meteor app). If you do need to configure or modify the REST API, the package also provides several options that you can use in your publication or meteor method definition. The package also enforces all your app's security rules and authorization.
For example, if your app had a publication called openTasks, then the corresponding REST endpoint would be.
GET /publications/openTasks
There are quite a few packages at https://atmospherejs.com/?q=rest that can expose your Meteor methods as RESTful API points which your Java app can consume.