/**
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014 - 2015 ForgeRock AS.
*/
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <setjmp.h>
#include "platform.h"
#include "am.h"
#include "utility.h"
#include "list.h"
#include "cmocka.h"
struct cookie_table
{
int c;
};
struct cookie_ctx
{
};
#define TOKEN_VALUE "AQIC5wM2LY4Sfcyro187TdQ7LJIs373_tJP4Lb2VXBv-Qoc.*AAJTSQACMDEAAlNLABM5MjExNjg2Nzk3Mjg3MjI4MDA2*"
{
int i;
for (i = 0; i < table->c; i++)
return 0;
}
{
int i = 0;
i++;
{
if (i == table->c)
table->c++;
}
}
{
int i;
for (i = 0; i < table->c; i++)
{
}
table->c = 0;
}
{
int i;
int c = 0;
for (i = 0; i < table->c; i++)
{
c++;
}
if (c == 0)
}
{
int i;
for (i = 0; i < table->c; i++)
{
}
}
{
int i;
int c = 0;
printf("table is NULL !!!!\n");
return;
}
for (i = 0; i < table->c; i++) {
}
}
}
{
return AM_SUCCESS;
}
const char * c;
if (c == NULL)
{
}
else
{
}
return AM_SUCCESS;
}
{
/*value is empty, sdk is setting a cookie in response*/
}
/* Apache HTTPD keeps two separate server response header tables in the request
* record — one for normal response headers and one for error headers.
* The difference between them is the error headers are sent to
* the client even (not only) on an error response (REDIRECT is one of them)
*/
return AM_SUCCESS;
}
static am_status_t set_header_in_request(struct am_request * rq, const char * key, const char * value)
{
/* remove all instances of the header first */
{
}
return AM_SUCCESS;
}
static am_status_t set_custom_response(am_request_t * rq, const char * text, const char * cont_type)
{
{
return AM_EINVAL;
}
switch (status)
{
case AM_JSON_RESPONSE:
{
}
break;
case AM_INTERNAL_REDIRECT:
{
}
break;
case AM_REDIRECT:
{
}
break;
case AM_PDP_DONE:
{
printf("set_custom_response(): issuing sub-request %s to %s (%s)",
}
break;
default:
{
printf("set_custom_response(): setting content %s to %s (%s): %s\n",
}
break;
}
return AM_SUCCESS;
}
{
return el;
}
int array_len = 0;
{
{ "ldap-session-0", "Session-header-0" },
{ "ldap-session-1", "Session-header-1" },
};
{
{ "ldap-profile-0", "Profile-header-0" },
{ "ldap-profile-1", "Profile-header-1" },
};
{
{ "ldap-response-0", "Response-header-0" },
{ "ldap-response-1", "Response-header-1" },
};
{
};
{
.instance_id = 0,
.override_host = AM_TRUE,
.resolve_client_host = 0,
.cdsso_enable = AM_TRUE,
};
{
.instance_id = 0,
.client_ip = "209.173.53.167",
.client_host = "d.e.f",
.method = AM_REQUEST_GET,
.status = AM_SUCCESS,
.token = TOKEN_VALUE,
};
/* test the function */
}
int array_len = 0;
{
{ "ldap-session-0", "Session-header-0" },
{ "ldap-session-1", "Session-header-1" },
};
{
{ "ldap-profile-0", "Profile-header-0" },
{ "ldap-profile-1", "Profile-header-1" },
};
{
{ "ldap-response-0", "Response-header-0" },
{ "ldap-response-1", "Response-header-1" },
};
{
};
{
.instance_id = 0,
.override_host = AM_TRUE,
.resolve_client_host = 0,
.pdp_enable = AM_TRUE,
.cdsso_enable = AM_TRUE,
};
{
.instance_id = 0,
.client_ip = "209.173.53.167",
.client_host = "d.e.f",
.token = TOKEN_VALUE,
};
}