Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5054

Using arbitrary URI schemes

$
0
0

I have a tool that needs config which is specified in yaml. The user can specify different resource types to connect to, for example, there is bar and baz type resources. bar are accessed via internet and baz are accessed via files (but there could be other resources, like boo that are accessible both by file or by network).

For convenience I just defined the config like

resources: 'bar://remote.system.com:6776/'

or

resources: 'baz:///home/troglodyte/supertool/jan22.baz'

Then I added the possibility to filter the content by a query string

resources: 'baz:///home/troglodyte/supertool/jan22.baz?minsize=10&color=grey'

which pre-filters the respective resource.

Is there anything wrong with using URIs with such "self-defined" schemes, when bar:// and baz:// are not standardized known protocols and might just be types of files that only exist in the universe of my tool? Like, technically this is fine, but does it go against an established common practice?

Extra question, if bar technically uses HTTP (under the hood) does this matter at all? (I'm aware of bar+http://, bar+ssh:// that people have recently been using.)

Even further, what if I used URI schemes to "navigate" in a document database, say I would specify doc://customers/13/sales_volume? The question essentially is whether the use of an URI scheme should be linked to any semantics or whether it's free for all.

(Technically, it could be argued that s3://bucket/target URIs do not truly point to a network resource, since they are missing the : (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html#accessing-a-bucket-using-S3-format) )

Finally, if I should not use URIs, what is the next best thing I should use?


Viewing all articles
Browse latest Browse all 5054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>