From b50766d496010bf2856dac88d97c236cf5944ae6 Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Tue, 18 Feb 2025 15:25:49 +0000 Subject: Restart git history without references to work email Previous commits: Author: Nat Lasseter Date: 2025-02-18 15:15:27 +0000 [3.2] Tickets have fixed 8-hour lifetimes now Author: Nat Lasseter Date: 2025-02-18 15:15:27 +0000 [3.11] Added .keytab file, got rid of get_ticket. Author: Nat Lasseter Date: 2025-02-18 15:15:27 +0000 [3.1] Added the TGS Author: Nat Lasseter Date: 2025-02-18 15:15:27 +0000 Add readme Author: Nat Lasseter Date: 2025-02-18 15:15:27 +0000 Up to end of scene 2 --- 3.1/get_mail.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 3.1/get_mail.rb (limited to '3.1/get_mail.rb') diff --git a/3.1/get_mail.rb b/3.1/get_mail.rb new file mode 100755 index 0000000..b212aed --- /dev/null +++ b/3.1/get_mail.rb @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby + +require 'net/http' +require 'uri' +require 'json' + +uri = URI.parse("http://localhost:4568/login") + +header = {'Content-Type': 'text/json'} + +print "Username: "; un = gets.strip +print "Ticket: "; t = gets.strip + +login = { + "username": un, + "ticket": t +} + +http = Net::HTTP.new(uri.host, uri.port) +request = Net::HTTP::Post.new(uri.request_uri, header) +request.body = login.to_json + +response = http.request(request) +puts response.body -- cgit v1.2.1