Means to customize request url by parameters.
Created by: vladfedin
Say, we got "base_url" : "http://s3.amazonaws.com", in api-description. But to access special buckets we actually need to change url to something like bucketname.s3.amazonaws.com for each request. I saw good examples of path customization in api descriptions like this one: "path" : "/:format/repos/key/:user/:repo/add", "required_params" : [ "format", "user", "repo" ], but i cant find any methods to make something like "url" : ":bucketname.:base_url", "required_params" : [ "bucketname" ], in request description.
My solution also seems not to really fit in Spore architecture philosophy: i just define "bucketName" : true in request description "get_bucket" : { "bucketName" : true, and then in AWS authentication middleware module look for req.env.spore.aws_parameters.bucketName and add it to req.env.SERVER_NAME = bucketname .. "." .. req.env.SERVER_NAME manually.
So the request looks like res = aws:get_bucket { ... aws_parameters = { bucketName = 'testbucketname'; }; } and url used for it is modified by testbucketname. prefix.
Again, question is if this hack is viable or I missed some more regular means in Spore code?