Export the metadata for your downloaded iTunes mobile applications

Put together a bit of Groovy code that will traverse your iTunes Mobile Applications directory and extract the metadata for each download. The aggregated metadata is exported to a csv.

Lots of interesting stuff in there. Looks like I currently have 60 applications downloaded (I tend to delete apps from iTunes that I’m not interested in) and have spent about $60. Most of the applications are free with a few larger ticket iPad application purchases.

The code has been posted to gist.

Unfortunately it does need to be run on an OS X machine right now in order to get around some conversion issues between binary and text metadata formats. That may change at some point.

Custom AuthenticationProvider w/ Grails + Spring Security

For the past couple of weeks, we’ve been putting some work into a new integration platform and a series of user persona-specific applications built on top of it.

Currently, the integration platform is largely plumbing with the eventual goal of supporting numerous pluggable services (think new APIs). Platform developers will have access to common messaging and asynchronous task execution services, and be able to write their components in a variety of JVM languages (Java, Groovy and Scala).

I’d love to standardize on Scala but it’s a bit early to draw that line in the sand.

To properly exercise this new platform, we’ve been working on a couple proof of concept applications. Today’s task was to investigate mechanisms for authentication and authorization. These applications are deployed independently from the core integration platform and will communicate primarily over REST APIs or asynchronous message passing.

The first proof of concept application was built using Grails and setup to use Spring Security for managing authentication. In contrast to a few other unnamed Grails plugins, the integration w/ Spring Security is quite well documented.

Our plan of attack was to replace the default AuthenticationProvider in Spring Security with one capable of hitting a platform API. This platform API would handle both authentication of the username/password (probably basic auth to start) and authorization. The later accomplished by returning a list of user roles that the application can use to secure individual controller/services.

Simple enough.

Replace the daoAuthenticationProvider

resources.groovy

[java]
// Place your Spring DSL code here

beans = {

platformAuthenticationProvider(org.jordens.PlatformAuthenticationProvider) {

// no attribute

}

}
[/java]

Config.groovy

[java]
grails.plugins.springsecurity.providerNames = [‘platformAuthenticationProvider’,

‘anonymousAuthenticationProvider’,

‘rememberMeAuthenticationProvider’]

[/java]

It’s important that the same bean id (platformAuthenticationProvider in this case) is specified in both resources.groovy and Config.groovy.

src/main/org/jordens/PlatformAuthenticationProvider

[java]
class PlatformAuthenticationProvider implements AuthenticationProvider
{
public static final String API_ROOT = "http://localhost:8080/platform/api/"

Authentication authenticate(Authentication authentication)
{
if (authentication instanceof UsernamePasswordAuthenticationToken)
{
UsernamePasswordAuthenticationToken token = (UsernamePasswordAuthenticationToken) authentication

String username = token.getPrincipal()
String password = token.getCredentials()

def roles = []
RESTClient client = new RESTClient(API_ROOT, ContentType.JSON)
try
{
HttpResponseDecorator r = (HttpResponseDecorator) client.get(
path: "users/${username}/roles",
query: [‘app-id': ‘user-management’])

JSONArray json = (JSONArray) r.data
json.each { String roleName ->
roles < < new GrantedAuthorityImpl(roleName)
}
}
catch (HttpResponseException e)
{
e.printStackTrace()
}

if (roles)
{
return new UsernamePasswordAuthenticationToken(username, password, roles)
}
}
return null
}

boolean supports(Class<? extends Object> aClass)
{
if (aClass.isAssignableFrom(UsernamePasswordAuthenticationToken.class))
{
return true
}

return false
}
}
[/java]

The PlatformAuthenticationProvider only supports username and password tokens (similar to the daoAuthenticationProvider). As it stands right now, it’s quite rudimentary and simply attempts to lookup a user using a platform API. If the user exists, a list of roles will be returned and converted into GrantedAuthorities for integration with Grails/Spring Security.

Success. In a few hours on a Friday afternoon, we satisfied our goal of eliminating built-in credentials from the Grails application in favor of existing platform APIs. Moving forward, this authentication provider will need to be updated and pass credentials to the platform API.

Sanofi Aventis developing iPad Applications?

Was just glancing through the New and notable list of iPad applications and noticed GoMealsHD.

Powered by the CalorieKing nutritional database, GoMeals allows you to search thousands of foods and dishes from popular restaurants, grocery stores and the items you have in your own kitchen to easily see the nutritional value (i.e. calories, carbohydrates, fats, protein, etc.) of the foods you eat. You may also track your daily food intake by saving food items to your "Today’s Plate" on the application’s calendar. You can monitor each day’s caloric intake, as well as the distribution of carbs, fats, and proteins. If you’re going out to eat, use the restaurant locator to easily find restaurants nearby and browse their menu and the nutritional information for the menu items to help support the best choices for you. Everything you need to develop a more nutritious eating plan is in one easy application.

It doesn’t look like it’s a particularly new app (press release) but it’s just now graced the New and notable list.  Should likely receive a healthy bump in # of users.

 

It may seem strange for a pharmaceutical giant like Sanofi to be developing iOS applications (motivations?), but it does look like an interesting health outreach project on the company’s part. 

There’s even a twitter account for the application (gomeals).

 

Here’s hoping they make special note of the so-called death on a bun Ultimate Grilled Cheeseburger Melt (1500+ calories, ~100g fat and more sodium than you can shake a fist at).