gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[reclaim-oidc] 11/18: 0.0.5


From: gnunet
Subject: [reclaim-oidc] 11/18: 0.0.5
Date: Sat, 12 Jun 2021 00:40:47 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository reclaim-oidc.

commit bf6bb598c9f57794d756d4147d3a271386e1473a
Author: Schanzenbach, Martin <mschanzenbach@posteo.de>
AuthorDate: Tue Apr 30 16:10:38 2019 +0200

    0.0.5
---
 lib/reclaim_oidc.rb  | 38 ++++++++++++++++++++------------------
 reclaim-oidc.gemspec |  4 ++--
 2 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/lib/reclaim_oidc.rb b/lib/reclaim_oidc.rb
index 2f5151b..c7ccaaf 100644
--- a/lib/reclaim_oidc.rb
+++ b/lib/reclaim_oidc.rb
@@ -1,14 +1,18 @@
 require 'net/http'
 require 'json'
 
+$VERSION_MAJOR = 0
+$VERSION_MINOR = 0
+$VERSION_MICRO = 5
+
 class ReclaimOidc
   def initialize(verbose=false, url='http://localhost:7776')
     @verbose = verbose
     @url = url
     @client_secret = get_client_secret()
   end
-  def self.hello
-    puts "Hello World!"
+  def self.version
+    return "#{$VERSION_MAJOR}.#{$VERSION_MINOR}.#{$VERSION_MICRO}"
   end
   def parse_identities_from_http(body)
     arr = JSON.parse(body)
@@ -48,25 +52,18 @@ class ReclaimOidc
       resp = http.post(uri.path, payload.to_json)
     end
     uri = URI(@url + "/namestore/#{name}")
-    record = {'record_type' => "RECLAIM_OIDC_CLIENT",
+    records = {'record_name' => "@",
+               'data' => []}
+    records["data"] << {'record_type' => "RECLAIM_OIDC_CLIENT",
               'value' => description,
-              'record_name' => "@",
               'expiration_time' => "1h",
               'flag' => 8}
-    #resp = Net::HTTP.post(uri,record.to_json)
-    #req = Net::HTTP::Post.new(uri, record)
-    Net::HTTP.start(uri.host, uri.port) do |http|
-      resp = http.post(uri.path,record.to_json)
-    end
-    record = {'record_type' => "RECLAIM_OIDC_REDIRECT",
+    records["data"] << {'record_type' => "RECLAIM_OIDC_REDIRECT",
               'value' => redirect_uri,
-              'record_name' => "@",
               'expiration_time' => "1h",
               'flag' => 8}
-    #req = Net::HTTP::Post.new(uri, record)
-    #resp = Net::HTTP.post(uri,record.to_json)
     Net::HTTP.start(uri.host, uri.port) do |http|
-      resp = http.post(uri.path,record.to_json)
+      resp = http.post(uri.path,records.to_json)
     end
   end
   def delete_client(name)
@@ -105,11 +102,16 @@ class ReclaimOidc
     end
     def parse_client_info(obj)
       obj.each do |record|
-        if (record['record_type'] == 'RECLAIM_OIDC_CLIENT')
-          @description = record['value']
+        if "@" != record["record_name"]
+          next
         end
-        if (record['record_type'] == 'RECLAIM_OIDC_REDIRECT')
-          @redirect_uri = record['value']
+        record["data"].each do |data|
+          if (data['record_type'] == 'RECLAIM_OIDC_CLIENT')
+            @description = data['value']
+          end
+          if (data['record_type'] == 'RECLAIM_OIDC_REDIRECT')
+            @redirect_uri = data['value']
+          end
         end
       end
     end
diff --git a/reclaim-oidc.gemspec b/reclaim-oidc.gemspec
index 0dfb0c7..db414f8 100644
--- a/reclaim-oidc.gemspec
+++ b/reclaim-oidc.gemspec
@@ -1,7 +1,7 @@
 Gem::Specification.new do |s|
   s.name        = 'reclaim-oidc'
-  s.version     = '0.0.4'
-  s.date        = '2019-04-28'
+  s.version     = '0.0.5'
+  s.date        = '2019-04-30'
   s.summary     = "re:claimID OpenID Connect CLI"
   s.description = "Used to manage re:claimID OpenID Connect clients and OpenID 
Connect Provider configuration(s)"
   s.authors     = ["Martin Schanzenbach"]

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]