YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.fcast.discovery.FCastConnectionUrl Class Reference

The connection URL of an FCast receiver (task 5.5): fcast://r/<base64url of a JSON>, the text of the QR code that both FUTO receivers show. More...

Collaboration diagram for de.yaacc.fcast.discovery.FCastConnectionUrl:
Collaboration graph

Classes

class  Parsed
 What a good link says.
 
enum  Problem
 Why a link was not accepted. More...
 
class  Result
 The parsed link or the problem.
 

Static Public Member Functions

static boolean looksLikeLink (String text)
 True if the text (trimmed) starts with the prefix of the connection URL; says nothing about the rest.
 
static Result parse (String text)
 

Static Public Attributes

static final String PREFIX = "fcast://r/"
 
static final int MAX_URL = 4096
 
static final int MAX_ADDRESSES = 16
 

Detailed Description

The connection URL of an FCast receiver (task 5.5): fcast://r/<base64url of a JSON>, the text of the QR code that both FUTO receivers show.

The JSON is {name, addresses[], services[{port, type}], txt?}; service type 0 is the FCast TCP service. Pure.

Everything in the link is untrusted: any app or web page can hand the app a link, a QR code can be printed by anyone. So: the exact prefix; at most {@value MAX_URL} characters, checked before anything is decoded; strict base64url (with or without padding), strict UTF-8, a JSON of limited depth and no single quotes, comments or trailing text; only IP literals of the local network as addresses (private, link-local IPv4, unique-local IPv6; no host names, no ports, no loopback, no public address, no IPv6 link-local address, which needs a zone the link can not give); only the first valid TCP service gives the port; at most {@value MAX_ADDRESSES} addresses; the name is cleaned and cut. The hints (v, fp) are kept for protocol v4 and are not authenticated. Nothing here connects, stores or logs.


The documentation for this class was generated from the following file: