Skip to content

Commit 2802fb7

Browse files
committed
Fix for ticket max age
1 parent bf1e717 commit 2802fb7

File tree

3 files changed

+47
-6
lines changed

3 files changed

+47
-6
lines changed

build.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@
309309
<file name="testAuthentication12.js"/>
310310
<file name="testAuthentication13.js"/>
311311
<file name="testAuthentication14.js"/>
312+
<file name="testAuthentication15.js"/>
312313

313314
<!-- html5 local, sesson and memory storage -->
314315
<file name="testAuthenticationStorage1.js"/>
@@ -491,6 +492,9 @@
491492
<file name="testStackRoles1.js"/>
492493
<file name="testStackTeamRoles1.js"/>
493494

495+
<!-- custom tests -->
496+
<file name="testCustom1.js"/>
497+
494498
</filelist>
495499
</concat>
496500

js/gitana/Gitana.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@
677677
"password": null,
678678
"accessToken": null,
679679
"ticket": null,
680-
"cookie": null
680+
"cookie": null,
681+
"ticketMaxAge": null
681682
};
682683
Gitana.copyKeepers(config, Gitana.loadDefaultConfig());
683684
Gitana.copyKeepers(config, settings);
@@ -690,6 +691,12 @@
690691
{
691692
var platform = this;
692693

694+
// params to /auth/info
695+
var authInfoParams = {};
696+
if (config.ticketMaxAge) {
697+
authInfoParams.ticketMaxAge = config.ticketMaxAge;
698+
}
699+
693700
// we provide a fallback if no flow type is specified, using "password" flow with guest/guest
694701
if (!config.code && !config.username && !config.accessToken && !config.cookie && !config.ticket)
695702
{
@@ -709,7 +716,7 @@
709716
driver.currentPlatform = null;
710717

711718
// fetch the auth info
712-
driver.gitanaGet("/auth/info", {}, function(response) {
719+
driver.gitanaGet("/auth/info", authInfoParams, function(response) {
713720

714721
var authInfo = new Gitana.AuthInfo(response);
715722
driver.setAuthInfo(authInfo);
@@ -749,7 +756,7 @@
749756
driver.currentPlatform = null;
750757

751758
// retrieve auth info and plug into the driver
752-
driver.gitanaGet("/auth/info", {}, function(response) {
759+
driver.gitanaGet("/auth/info", authInfoParams, function(response) {
753760
var authInfo = new Gitana.AuthInfo(response);
754761
driver.setAuthInfo(authInfo);
755762

@@ -788,7 +795,7 @@
788795
driver.currentPlatform = null;
789796

790797
// fetch the auth info
791-
driver.gitanaGet("/auth/info", {}, function(response) {
798+
driver.gitanaGet("/auth/info", authInfoParams, function(response) {
792799

793800
var authInfo = new Gitana.AuthInfo(response);
794801
driver.setAuthInfo(authInfo);
@@ -827,7 +834,7 @@
827834
driver.currentPlatform = null;
828835

829836
// fetch the auth info
830-
driver.gitanaGet("/auth/info", {}, function(response) {
837+
driver.gitanaGet("/auth/info", authInfoParams, function(response) {
831838

832839
var authInfo = new Gitana.AuthInfo(response);
833840
driver.setAuthInfo(authInfo);
@@ -867,7 +874,7 @@
867874
driver.currentPlatform = null;
868875

869876
// fetch the auth info
870-
driver.gitanaGet("/auth/info", {}, function(response) {
877+
driver.gitanaGet("/auth/info", authInfoParams, function(response) {
871878

872879
var authInfo = new Gitana.AuthInfo(response);
873880
driver.setAuthInfo(authInfo);

tests/js/testCustom1.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
(function() {
2+
3+
/**
4+
* This test is here as a means of providing a place that support can quickly plugin tests for customer
5+
* environments. In the stock test framework, it doesn't do anything other than NOOP out.
6+
*/
7+
8+
module("custom1");
9+
10+
// Test case : Custom Test #1
11+
test("Gitana Custom #1", function()
12+
{
13+
stop();
14+
15+
/*
16+
Gitana.connect({
17+
'baseURL': "http://TODO",
18+
'ticketMaxAge': 5
19+
}).then(function() {
20+
console.log('CONNECTED');
21+
22+
start();
23+
});
24+
*/
25+
26+
start();
27+
28+
});
29+
30+
}());

0 commit comments

Comments
 (0)