From 40c34bb6427f634ee4c9fc4fe7539d7f993abc19 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Thu, 21 Apr 2016 21:23:25 +0000 Subject: Update the GUI to work with the new rcynicdb. svn path=/branches/tk705/; revision=6365 --- rpki/gui/cacheview/forms.py | 51 --------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 rpki/gui/cacheview/forms.py (limited to 'rpki/gui/cacheview/forms.py') diff --git a/rpki/gui/cacheview/forms.py b/rpki/gui/cacheview/forms.py deleted file mode 100644 index 7ae3601f..00000000 --- a/rpki/gui/cacheview/forms.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2011 SPARTA, Inc. dba Cobham Analytic Solutions -# Copyright (C) 2013 SPARTA, Inc. a Parsons Company -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND SPARTA DISCLAIMS ALL WARRANTIES WITH -# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS. IN NO EVENT SHALL SPARTA BE LIABLE FOR ANY SPECIAL, DIRECT, -# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -# PERFORMANCE OF THIS SOFTWARE. - -__version__ = '$Id$' - -from django import forms - -from rpki.gui.cacheview.misc import parse_ipaddr -from rpki.exceptions import BadIPResource -from rpki.resource_set import resource_range_as - - -class SearchForm(forms.Form): - asn = forms.CharField(required=False, help_text='AS or range', label='AS') - addr = forms.CharField(required=False, max_length=40, help_text='range/CIDR', label='IP Address') - - def clean(self): - asn = self.cleaned_data.get('asn') - addr = self.cleaned_data.get('addr') - if (asn and addr) or ((not asn) and (not addr)): - raise forms.ValidationError('Please specify either an AS or IP range, not both') - - if asn: - try: - resource_range_as.parse_str(asn) - except ValueError: - raise forms.ValidationError('invalid AS range') - - if addr: - #try: - parse_ipaddr(addr) - #except BadIPResource: - # raise forms.ValidationError('invalid IP address range/prefix') - - return self.cleaned_data - - -class SearchForm2(forms.Form): - resource = forms.CharField(required=True) -- cgit v1.2.3 ame/ca/tests?h=zone-cleanup&id=429adae788694f109174e35467c49d13b9533fe2'>tests/testpoke.xsl
blob: 91658b0bf6b0c1375913cb44fc8f390b3dd0c067 (plain) (tree)













































































                                                                                     
<!--  -*- SGML -*-
  - $Id$
  -
  - Copyright (C) 2008  American Registry for Internet Numbers ("ARIN")
  -
  - Permission to use, copy, modify, and distribute this software for any
  - purpose with or without fee is hereby granted, provided that the above
  - copyright notice and this permission notice appear in all copies.
  -
  - THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH
  - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  - AND FITNESS.  IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT,
  - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  - PERFORMANCE OF THIS SOFTWARE.
 --> 

<!--
  - Decoder ring for testpoke.py XML output.  Use this to get a
  - (somewhat) human-readable listing and to put OpenSSL-style
  - delimiters onto the certificates so that "openssl x509" can read
  - the result.  With a tad more work, we could select just one out of
  - the set of multiple certificates, or output YAML.  For the moment,
  - I'll settle for being readable by human beings and OpenSSL.
 --> 

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	       xmlns:rpkiud="http://www.apnic.net/specs/rescerts/up-down/">

  <xsl:output method="text"/>

  <xsl:param name="show-issuer" select="0"/>

  <xsl:template match="/rpkiud:message[@type = 'list_response']">
    <xsl:value-of select="concat('[Message]',                 '&#10;',
                                 'Version:     ', @version,   '&#10;',
                                 'Sender:      ', @sender,    '&#10;',
				 'Recipient:   ', @recipient, '&#10;')"/>
    <xsl:apply-templates select="rpkiud:class"/>
  </xsl:template>

  <xsl:template match="rpkiud:class">
    <xsl:value-of select="concat('&#10;',
				 '[Class]',                               '&#10;',
				 'Name:        ', @class_name,            '&#10;',
                                 'Issuer URL:  ', @cert_url,              '&#10;',
				 'ASNs:        ', @resource_set_as,       '&#10;',
				 'IPv4:        ', @resource_set_ipv4,     '&#10;',
				 'IPv6:        ', @resource_set_ipv6,     '&#10;',
				 'NotAfter:    ', @resource_set_notafter, '&#10;',
				 'SIA head:    ', @suggested_sia_head,    '&#10;')"/>
    <xsl:if test="$show-issuer">
      <xsl:apply-templates select="rpkiud:issuer"/>
    </xsl:if>
    <xsl:apply-templates select="rpkiud:certificate"/>
  </xsl:template>

  <xsl:template match="rpkiud:certificate">
    <xsl:value-of select="concat('&#10;',
                                 '[Certificate]',                     '&#10;',
				 'Subject URL: ', @cert_url,          '&#10;',
				 'Req ASNs:    ', @resource_set_as,   '&#10;',
				 'Req IPv4:    ', @resource_set_ipv4, '&#10;',
				 'Req IPv6:    ', @resource_set_ipv6, '&#10;')"/>
    <xsl:call-template name="show-pem"/>
  </xsl:template>

  <xsl:template match="rpkiud:issuer" name="show-pem">
    <xsl:text>&#10;</xsl:text>
    <xsl:text>-----BEGIN CERTIFICATE-----</xsl:text>
    <xsl:text>&#10;</xsl:text>
    <xsl:value-of select="text()"/>
    <xsl:text>-----END CERTIFICATE-----</xsl:text>
    <xsl:text>&#10;</xsl:text>
  </xsl:template>

</xsl:transform>