Class OA2ClientUtils


  • public class OA2ClientUtils
    extends Object
    A budding set of utilities for working with clients.

    Created by Jeff Gaynor
    on 3/17/14 at 12:57 PM

    • Constructor Detail

      • OA2ClientUtils

        public OA2ClientUtils()
    • Method Detail

      • check

        public static void check​(Client client,
                                 String redirect)
        Note that all of the exceptions thrown here are because the callback cannot be verified, hence it is unclear where the error is to be sent.
        Parameters:
        client -
        redirect -
      • createCallbacks

        public static LinkedList<String> createCallbacks​(List<String> rawCBs,
                                                         List<String> dudUris)
                                                  throws IOException
        This takes a list of callbacks and checks policies for each of them. This does the actual work for checking
        Parameters:
        rawCBs -
        dudUris - -- this is a list of any URIs that are rejected. The caller may do with them what they will.
        Returns:
        Throws:
        IOException
      • createCallbacksForWebUI

        public static LinkedList<String> createCallbacksForWebUI​(OA2Client client,
                                                                 String rawCBs)
                                                          throws IOException
        This is for use with the web interface. The string in this case is the contents of a textbox that has one callback per line. Each callback is processed.
        Parameters:
        client -
        rawCBs -
        Returns:
        Throws:
        IOException
      • toQuad

        protected static int[] toQuad​(String address)
        Used when resolving which network from its dotted quad address.
        Parameters:
        address -
        Returns:
      • isOnPrivateNetwork

        protected static boolean isOnPrivateNetwork​(String address)
      • isPrivate

        protected static boolean isPrivate​(String host,
                                           String scheme)
      • setupDriverPayloadConfig

        public static void setupDriverPayloadConfig​(AbstractPayloadConfig pc,
                                                    OA2Client client)
        Assumes that the configuration for the client is just a qdl script element or list of them.
        Parameters:
        pc -
        client -