Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
a3148434
Commit
a3148434
authored
Nov 09, 2010
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add methods to return an authority's api level and api (AM, CM).
parent
ee9f9a2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
3 deletions
+47
-3
protogeni/lib/GeniAuthority.pm.in
protogeni/lib/GeniAuthority.pm.in
+47
-3
No files found.
protogeni/lib/GeniAuthority.pm.in
View file @
a3148434
...
@@ -95,6 +95,8 @@ sub Lookup($$)
...
@@ -95,6 +95,8 @@ sub Lookup($$)
my
$
self
=
{};
my
$
self
=
{};
$
self
->{
'AUTHORITY'
}
=
$
query_result
->
fetchrow_hashref
();
$
self
->{
'AUTHORITY'
}
=
$
query_result
->
fetchrow_hashref
();
$
self
->{
'version'
}
=
undef
;
$
self
->{
'version'
}
=
undef
;
$
self
->{
'apilevel'
}
=
undef
;
$
self
->{
'api'
}
=
undef
;
bless
($
self
,
$
class
);
bless
($
self
,
$
class
);
#
#
...
@@ -178,7 +180,9 @@ sub url($) { return field($_[0], "url"); }
...
@@ -178,7 +180,9 @@ sub url($) { return field($_[0], "url"); }
sub
hrn
($)
{
return
field
($
_
[
0
],
"hrn"
);
}
sub
hrn
($)
{
return
field
($
_
[
0
],
"hrn"
);
}
sub
type
($)
{
return
field
($
_
[
0
],
"type"
);
}
sub
type
($)
{
return
field
($
_
[
0
],
"type"
);
}
sub
disabled
($)
{
return
field
($
_
[
0
],
"disabled"
);
}
sub
disabled
($)
{
return
field
($
_
[
0
],
"disabled"
);
}
sub
version
($)
{
return
field
($
_
[
0
],
"version"
);
}
sub
version
($)
{
return
$
_
[
0
]->{
"version"
};
}
sub
apilevel
($)
{
return
$
_
[
0
]->{
"apilevel"
};
}
sub
api
($)
{
return
$
_
[
0
]->{
"api"
};
}
sub
cert
($)
{
return
$
_
[
0
]->{
'CERT'
}->
cert
();
}
sub
cert
($)
{
return
$
_
[
0
]->{
'CERT'
}->
cert
();
}
sub
GetCertificate
($)
{
return
$
_
[
0
]->{
'CERT'
};
}
sub
GetCertificate
($)
{
return
$
_
[
0
]->{
'CERT'
};
}
...
@@ -329,13 +333,53 @@ sub Version($)
...
@@ -329,13 +333,53 @@ sub Version($)
return
undef
;
return
undef
;
}
}
if
(
ref
($
response
->
value
()))
{
if
(
ref
($
response
->
value
()))
{
$
self
->{
'version'
}
=
$
response
->
value
()->{
'api'
};
#
Look
for
the
AM
interface
.
if
(
exists
($
response
->
value
()->{
'geni_api'
}))
{
$
self
->{
'version'
}
=
$
response
->
value
()->{
'geni_api'
};
#
This
was
wrong
;
it
should
be
2.0
not
1.0
$
self
->{
'version'
}
=
2.0
if
($
self
->{
'version'
}
==
1.0
);
$
self
->{
'apilevel'
}
=
0
;
$
self
->{
'api'
}
=
"AM"
;
}
else
{
$
self
->{
'version'
}
=
$
response
->
value
()->{
'api'
};
$
self
->{
'apilevel'
}
=
$
response
->
value
()->{
'level'
};
$
self
->{
'apilevel'
}
=
0
;
$
self
->{
'api'
}
=
"CM"
;
}
}
}
else
{
else
{
$
self
->{
'version'
}
=
$
response
->
value
();
$
self
->{
'version'
}
=
$
response
->
value
();
$
self
->{
'apilevel'
}
=
1
;
$
self
->{
'api'
}
=
"CM"
;
}
}
return
$
self
->{
'version'
};
return
$
self
->{
'version'
};
}
}
#
Ditto
for
the
API
level
sub
ApiLevel
($)
{
my
($
self
)
=
@
_
;
return
$
self
->
apilevel
()
if
(
defined
($
self
->
apilevel
()));
return
undef
if
(
!defined($self->Version()));
return
$
self
->
apilevel
();
}
sub
Api
($)
{
my
($
self
)
=
@
_
;
return
$
self
->
api
()
if
(
defined
($
self
->
api
()));
return
undef
if
(
!defined($self->Version()));
return
$
self
->
api
();
}
#
#
#
Check
that
the
authority
is
the
issuer
of
the
given
certificate
.
#
Check
that
the
authority
is
the
issuer
of
the
given
certificate
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment