Microsoft.SyncFileSyncProvider for REST Backend? - microsoft-sync-framework

I am trying to build my own Sync Desktop application like onedrive to sync with a REST backend. MS Sync FW seemed to be a good base for that. Now my approach would be to use the FileSyncProvider to cover the local files and write another Provider - closely based on the FileSyncProvider for the REST backend. Is this a viable approach?
The deeper I get into the Sync Framework the more I think that I might to write two custom providers - my own LocalFileSyncProvider and a RemoteFileSyncProvider. Are there any good examples for something like that?

I believe you might need to implement only one simple custom provider, the one that interacts with the REST service. Then you can synchronize between the out of the box FileSyncProvider and your simple custom provider.
If you want more information on the type of custom providers, check the following link:
Choosing a Custom Provider type
The code sample that you are looking for is here:
File Sync with Simple Custom Provider Sample

Related

Terraform UI for non technical CLI users?

I currently have a server build process that uses Terraform and deploys a server all from code.
I'm looking for a web UI with forms that I could either populate specific fields and or do API get commands against a VCenter or wherever the server is being built to populate the specific fields. The fields that get populated would be stored as the variables.tf file and when someone hits submit, it would run the actual Terraform command terraform apply to build the server based on the variables. My guess is the terraform binaries would have to live on there so it could run in the background.
It doesn't have to be some super fancy web page, just something that I could potentially make look cool for Director level folks.
Also, I don't want to use TF enterprise, yet. I've looked into a couple of open source projects (atlantis and terrahub) but none seem to be what I'm looking for.
I'm far from a web developer so any help would be awesome.
You can try with SLD
Stack-Lifecycle-Deployment
I think it has everything that you need
It is very intuitive, it has a web interface and a rest api to easily integrate it with the rest of the applications.

CLI/SDK to create Google-cloud oAuth client

Is it possible to create an OAuth client (https://developers.google.com/identity/protocols/OAuth2) using a script (gcloud or any library)?
Google recommended way (https://developers.google.com/identity/protocols/OAuth2WebServer#creatingcred) is to manually create from https://console.developers.google.com/apis/credentials.
I have multiple apps with different url_redirects like https://a.domain.com, https://b.domain.com https://c.domain.com, https://d.domain.com, this subdomain list is large to manage manually.
I want to automate this process for my use case. I'm not able to find any library to do this.
Update: Endpoint used by GCP console https://clientauthconfig.clients6.google.com/v1/clients and there is related permission also "clientauthconfig.clients.create" but there is no API provided for it.
You would need API client to create new API client anyway. Is it really necessary for you to create it this way? You can rather create multiple "user" credentials for your application using only that one API client.
I think you are looking for something like this, hope Java is good for you.
I've also found the following relevant information that might help you. Link
Also relevant for you. Link
Let me know.

Provide API for a Django project as a different docker service

I recently started to work on a friend's project in Django and we want to provide a REST API so other projects can consume our data. I'm starting to learn django-rest-framework (and django-rest-swagger for documentation). Is it possible to create the API as a separate service? this way we dockerize it and serve the api in one container, and keep the application on its original container preventing that if many requests to the API were made, it will not interfere on the application (by bringing it down for example). If it is not possible what is the best way for implement the API on the project?
Yes, this is possible. See here. Structurally, you will probably want to write the project by keeping all presentation-related apps separate from the API-related apps.

Need guidance on how to obtaining ADAL access_token in Ember SPA via JSLL

I have and Ember SPA that uses JSLL to interactively log a user in and then make cross-domain calls to our dependent services. I'm working on a VSTS Release definition that will deploy the app then invoke a particular 'health page' that executes synthetic transactions to the dependent services and reports.
What I need guidance on is the proper way to bypass the interactive login but still be able to acquire heedlessly the access_token(s) needed for the ajax calls to the dependent services.
VSTS provides a SYSTEM_ACCESSTOKEN build variable that would make secrets management very simple but I don't think it is well suited for what I'm trying to do.
The best way I can figure is to create a service principle in AAD, provision that account with my dependent services and programmatically login to acquire the token then just use that token for the Bearer token in the Authorization header.
Is there any better approach?
If that is the recommended approach can someone point me to the JSLL/ADAL API that would accomplish that?
You can refer this code sample to integrate Azure AD with Ember framework. After you download and run the project, you may find the error about container.lookup is not a function since the reference to Ember is the latest version.
To make the code sample work, you can replace the Ember reference using the version 2.0.0-beta.3 like below:
<script src="https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.0.0-beta.3/ember-template-compiler.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.0.0-beta.3/ember.js"></script>

How do I create a rest web service in Grails?

The idea is to call a method from a website(in php) to my application (in Grails). The application will serve data in json format.
The website and the application are hosted in two different servers. The website is on Yahoo and the application is on Rackspace.
Now, I want to create a web service in my Grails application which serves list of cities in json format.
City Class
class City {
String name
String code
}
How do i write the web service method?
Try the grails jaxrs plugin (https://github.com/krasserm/grails-jaxrs) which will do excactly what you want without any hassle.
Simply install it, create a Resource object with the introduced create-resource command and create and annotate the methods as you wish. all other things are managed by the plugin so you don't have to worry about Controller or UrlMapping...
You need only the annotation #Resource(uri='/cities') on your domain and call the url/cities.json (but, its'n RESTful)
You will want to use a few tools, first you will create a controller that deals with the requests and pushes them off to your service layer.
You can use URL Mappings to make it more RESTFul check out the doc that way all the http methods will be mapped to actions in your controller.
Also if you will be doing a fair bit of json I would recomend starting with the gson plugin it has a fuller feature set then the built in JSON support.
The link from the comment above is a great resource to read as well.
I have found that I most of the time want to support the accept header as well in which case you will need to update your config with the following code. See withFormat doc for more info.
grails.mime.use.accept.header = true