Sha256: 42ab9c1775ac3a81ec1a9c52e4a6cb18456e6ebb956bd8eb1a434cce2fa9f755
Contents?: true
Size: 1.02 KB
Versions: 1
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true class GlobusClient # Lookup of a Globus identity ID class Identity def initialize(client) @client = client end # @param user_id [String] the username in the form of an email addresss # @return [Hash] id and status of Globus identity def get_identity(user_id) response = client.get( base_url: client.config.auth_url, path: '/v2/api/identities', params: { usernames: user_id } ) response['identities'].find { |id| id['username'] == user_id } end # @param user_id [String] the username in the form of an email addresss # @return [Boolean] whether the account has a valid status def valid?(user_id) %w[used private unused].include?(get_identity(user_id)['status']) end # @param user_id [String] the username in the form of an email addresss # @return [String] UUID for Globus identity def get_identity_id(user_id) get_identity(user_id)['id'] end private attr_reader :client end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
globus_client-0.14.0 | lib/globus_client/identity.rb |