Sha256: fac0baeaf8e7cd350a41d87c9621950df71bdcb02429d4870614e408deb8be89

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

module Castronaut
  module Presenters

    class ProxyValidate < Base
      MissingCredentialsMessage = "Please supply a username and password to login."

      attr_reader :proxy_ticket_result, :proxies
      attr_accessor :login_ticket

      def proxy_granting_ticket_url
        params['pgtUrl']
      end

      def proxy_granting_ticket_iou
        @proxy_granting_ticket_result && @proxy_granting_ticket_result.iou
      end

      def username
        @proxy_ticket_result.username
      end
      
      def identifier
        @proxy_ticket_result.identifier
      end
      def extra_xml
        @proxy_ticket_result.extra_xml
      end

      def represent!
        @proxy_ticket_result = Castronaut::Models::ProxyTicket.validate_ticket(service, ticket)

        if @proxy_ticket_result.valid?
          @proxies = @proxy_ticket_result.proxies

          if proxy_granting_ticket_url
            @proxy_granting_ticket_result = Castronaut::Models::ProxyGrantingTicket.generate_ticket(proxy_granting_ticket_url, client_host, @proxy_ticket_result.ticket)
          end
        end

        @your_mission = { :template => :proxy_validate, :layout => false }

        self
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
3mix-castronaut-0.5.0.2 lib/castronaut/presenters/proxy_validate.rb