Skip to content

Commit d41a348

Browse files
authored
Merge pull request #15 from kbase/dev-gradle
Remove lookup_globus_user method
2 parents a4225d8 + 5a91b7d commit d41a348

File tree

13 files changed

+9
-356
lines changed

13 files changed

+9
-356
lines changed

RELEASE_NOTES.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
A lightweight service to store public KBase user profiles and related basic information.
44

5-
## VERSION: 0.2.2 (Released TDB)
5+
## VERSION: 0.3.0 (Released TDB)
66

77
* Switched the build system from Make / Ant to Gradle
8+
* The `lookup_globus_user` method was removed.
9+
* The `globus-url` configuration parameter was removed.
810

911
## VERSION: 0.2.1 (Released 4/1/19)
1012

UserProfile.spec

-9
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,5 @@ module UserProfile {
6767
todo: add some way to remove fields. Fields in profile can only be modified or added.
6868
*/
6969
funcdef update_user_profile(SetUserProfileParams p) returns () authentication required;
70-
71-
72-
typedef structure {
73-
string email;
74-
string fullName;
75-
string userName;
76-
} GlobusUser;
77-
78-
funcdef lookup_globus_user(list <username> usernames) returns (mapping <username,GlobusUser> users) authentication required;
7970
};
8071

deploy.cfg

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,4 @@ min-memory = 1000
3737
#Maximum memory size in MB.
3838
max-memory = 2000
3939

40-
auth-service-url = https://kbase.us/services/authorization
41-
globus-url = https://nexus.api.globusonline.org
40+
auth-service-url = https://ci.kbase.us/services/auth/api/legacy/KBase/Sessions/Login

deployment/conf/.templates/deployment.cfg.templ

-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ basedir={{ default .Env.basedir "user_profile" }}
2929

3030
auth-service-url = {{ default .Env.auth_service_url "https://ci-kbase.us/services/authorization" }}
3131
auth-service-url-allow-insecure = {{ default .Env.auth_service_allow_insecure "false" }}
32-
globus-url = {{ default .Env.globus_url "https://nexus.api.globusonline.org" }}

docshtml/UserProfile.html

+1-1
Large diffs are not rendered by default.

lib/Bio/KBase/UserProfile/Client.pm

+3-129
Original file line numberDiff line numberDiff line change
@@ -597,98 +597,6 @@ todo: add some way to remove fields. Fields in profile can only be modified or
597597
}
598598
}
599599

600-
601-
602-
=head2 lookup_globus_user
603-
604-
$users = $obj->lookup_globus_user($usernames)
605-
606-
=over 4
607-
608-
=item Parameter and return types
609-
610-
=begin html
611-
612-
<pre>
613-
$usernames is a reference to a list where each element is an UserProfile.username
614-
$users is a reference to a hash where the key is an UserProfile.username and the value is an UserProfile.GlobusUser
615-
username is a string
616-
GlobusUser is a reference to a hash where the following keys are defined:
617-
email has a value which is a string
618-
fullName has a value which is a string
619-
userName has a value which is a string
620-
621-
</pre>
622-
623-
=end html
624-
625-
=begin text
626-
627-
$usernames is a reference to a list where each element is an UserProfile.username
628-
$users is a reference to a hash where the key is an UserProfile.username and the value is an UserProfile.GlobusUser
629-
username is a string
630-
GlobusUser is a reference to a hash where the following keys are defined:
631-
email has a value which is a string
632-
fullName has a value which is a string
633-
userName has a value which is a string
634-
635-
636-
=end text
637-
638-
=item Description
639-
640-
641-
642-
=back
643-
644-
=cut
645-
646-
sub lookup_globus_user
647-
{
648-
my($self, @args) = @_;
649-
650-
# Authentication: required
651-
652-
if ((my $n = @args) != 1)
653-
{
654-
Bio::KBase::Exceptions::ArgumentValidationError->throw(error =>
655-
"Invalid argument count for function lookup_globus_user (received $n, expecting 1)");
656-
}
657-
{
658-
my($usernames) = @args;
659-
660-
my @_bad_arguments;
661-
(ref($usernames) eq 'ARRAY') or push(@_bad_arguments, "Invalid type for argument 1 \"usernames\" (value was \"$usernames\")");
662-
if (@_bad_arguments) {
663-
my $msg = "Invalid arguments passed to lookup_globus_user:\n" . join("", map { "\t$_\n" } @_bad_arguments);
664-
Bio::KBase::Exceptions::ArgumentValidationError->throw(error => $msg,
665-
method_name => 'lookup_globus_user');
666-
}
667-
}
668-
669-
my $url = $self->{url};
670-
my $result = $self->{client}->call($url, $self->{headers}, {
671-
method => "UserProfile.lookup_globus_user",
672-
params => \@args,
673-
});
674-
if ($result) {
675-
if ($result->is_error) {
676-
Bio::KBase::Exceptions::JSONRPC->throw(error => $result->error_message,
677-
code => $result->content->{error}->{code},
678-
method_name => 'lookup_globus_user',
679-
data => $result->content->{error}->{error} # JSON::RPC::ReturnObject only supports JSONRPC 1.1 or 1.O
680-
);
681-
} else {
682-
return wantarray ? @{$result->result} : $result->result->[0];
683-
}
684-
} else {
685-
Bio::KBase::Exceptions::HTTP->throw(error => "Error invoking method lookup_globus_user",
686-
status_line => $self->{client}->status_line,
687-
method_name => 'lookup_globus_user',
688-
);
689-
}
690-
}
691-
692600

693601
sub status
694602
{
@@ -732,16 +640,16 @@ sub version {
732640
Bio::KBase::Exceptions::JSONRPC->throw(
733641
error => $result->error_message,
734642
code => $result->content->{code},
735-
method_name => 'lookup_globus_user',
643+
method_name => 'update_user_profile',
736644
);
737645
} else {
738646
return wantarray ? @{$result->result} : $result->result->[0];
739647
}
740648
} else {
741649
Bio::KBase::Exceptions::HTTP->throw(
742-
error => "Error invoking method lookup_globus_user",
650+
error => "Error invoking method update_user_profile",
743651
status_line => $self->{client}->status_line,
744-
method_name => 'lookup_globus_user',
652+
method_name => 'update_user_profile',
745653
);
746654
}
747655
}
@@ -987,40 +895,6 @@ profile has a value which is an UserProfile.UserProfile
987895
988896
989897
990-
=head2 GlobusUser
991-
992-
=over 4
993-
994-
995-
996-
=item Definition
997-
998-
=begin html
999-
1000-
<pre>
1001-
a reference to a hash where the following keys are defined:
1002-
email has a value which is a string
1003-
fullName has a value which is a string
1004-
userName has a value which is a string
1005-
1006-
</pre>
1007-
1008-
=end html
1009-
1010-
=begin text
1011-
1012-
a reference to a hash where the following keys are defined:
1013-
email has a value which is a string
1014-
fullName has a value which is a string
1015-
userName has a value which is a string
1016-
1017-
1018-
=end text
1019-
1020-
=back
1021-
1022-
1023-
1024898
=cut
1025899

1026900
package Bio::KBase::UserProfile::Client::RpcClient;

lib/biokbase/user_profile/client.py

-10
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,6 @@ def update_user_profile(self, p, context=None):
102102
return self._client.call_method('UserProfile.update_user_profile',
103103
[p], self._service_ver, context)
104104

105-
def lookup_globus_user(self, usernames, context=None):
106-
"""
107-
:param usernames: instance of list of type "username"
108-
:returns: instance of mapping from type "username" to type
109-
"GlobusUser" -> structure: parameter "email" of String, parameter
110-
"fullName" of String, parameter "userName" of String
111-
"""
112-
return self._client.call_method('UserProfile.lookup_globus_user',
113-
[usernames], self._service_ver, context)
114-
115105
def status(self, context=None):
116106
return self._client.call_method('UserProfile.status',
117107
[], self._service_ver, context)

lib/javascript/UserProfile/Client.js

-13
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,6 @@ function UserProfile(url, auth, auth_cb, timeout, async_job_check_time_ms, servi
8484
return json_call_ajax(_url, "UserProfile.update_user_profile",
8585
[p], 0, _callback, _errorCallback);
8686
};
87-
88-
this.lookup_globus_user = function (usernames, _callback, _errorCallback) {
89-
if (typeof usernames === 'function')
90-
throw 'Argument usernames can not be a function';
91-
if (_callback && typeof _callback !== 'function')
92-
throw 'Argument _callback must be a function if defined';
93-
if (_errorCallback && typeof _errorCallback !== 'function')
94-
throw 'Argument _errorCallback must be a function if defined';
95-
if (typeof arguments === 'function' && arguments.length > 1+2)
96-
throw 'Too many arguments ('+arguments.length+' instead of '+(1+2)+')';
97-
return json_call_ajax(_url, "UserProfile.lookup_globus_user",
98-
[usernames], 1, _callback, _errorCallback);
99-
};
10087

10188
this.status = function (_callback, _errorCallback) {
10289
if (_callback && typeof _callback !== 'function')

src/main/java/us/kbase/userprofile/GlobusUser.java

-96
This file was deleted.

src/main/java/us/kbase/userprofile/UserProfileClient.java

-17
Original file line numberDiff line numberDiff line change
@@ -292,23 +292,6 @@ public void updateUserProfile(SetUserProfileParams p, RpcContext... jsonRpcConte
292292
caller.jsonrpcCall("UserProfile.update_user_profile", args, retType, false, true, jsonRpcContext, this.serviceVersion);
293293
}
294294

295-
/**
296-
* <p>Original spec-file function name: lookup_globus_user</p>
297-
* <pre>
298-
* </pre>
299-
* @param usernames instance of list of original type "username"
300-
* @return parameter "users" of mapping from original type "username" to type {@link us.kbase.userprofile.GlobusUser GlobusUser}
301-
* @throws IOException if an IO exception occurs
302-
* @throws JsonClientException if a JSON RPC exception occurs
303-
*/
304-
public Map<String,GlobusUser> lookupGlobusUser(List<String> usernames, RpcContext... jsonRpcContext) throws IOException, JsonClientException {
305-
List<Object> args = new ArrayList<Object>();
306-
args.add(usernames);
307-
TypeReference<List<Map<String,GlobusUser>>> retType = new TypeReference<List<Map<String,GlobusUser>>>() {};
308-
List<Map<String,GlobusUser>> res = caller.jsonrpcCall("UserProfile.lookup_globus_user", args, retType, true, true, jsonRpcContext, this.serviceVersion);
309-
return res.get(0);
310-
}
311-
312295
public Map<String, Object> status(RpcContext... jsonRpcContext) throws IOException, JsonClientException {
313296
List<Object> args = new ArrayList<Object>();
314297
TypeReference<List<Map<String, Object>>> retType = new TypeReference<List<Map<String, Object>>>() {};

0 commit comments

Comments
 (0)