2019-02-10 05:20:37 +07:00
|
|
|
import { GET_Expect401, GET_ExpectRedirect } from "../../../helpers/utils/Requests";
|
|
|
|
|
|
|
|
export default function() {
|
|
|
|
describe('Query without authenticated cookie', function() {
|
2019-11-17 17:47:07 +07:00
|
|
|
it('should get a 401 on GET to http://authelia.example.com:9091/api/verify', async function() {
|
|
|
|
await GET_Expect401('http://authelia.example.com:9091/api/verify', {
|
2019-04-11 02:27:18 +07:00
|
|
|
'X-Forwarded-Proto': 'https',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Kubernetes nginx ingress controller', async function() {
|
|
|
|
it('should redirect to https://login.example.com:8080', async function() {
|
2019-11-17 17:47:07 +07:00
|
|
|
await GET_ExpectRedirect('http://authelia.example.com:9091/api/verify?rd=https://login.example.com:8080/%23/',
|
2019-04-25 04:52:08 +07:00
|
|
|
'https://login.example.com:8080/#/?rd=https://secure.example.com:8080/',
|
2019-04-11 02:27:18 +07:00
|
|
|
{
|
2019-04-25 04:52:08 +07:00
|
|
|
'X-Original-Url': 'https://secure.example.com:8080/',
|
2019-04-11 02:27:18 +07:00
|
|
|
'X-Forwarded-Proto': 'https'
|
|
|
|
});
|
|
|
|
});
|
2019-02-10 05:20:37 +07:00
|
|
|
});
|
|
|
|
|
2019-04-11 02:27:18 +07:00
|
|
|
describe('Traefik proxy', async function() {
|
2019-02-10 05:20:37 +07:00
|
|
|
it('should redirect to https://login.example.com:8080', async function() {
|
2019-11-17 17:47:07 +07:00
|
|
|
await GET_ExpectRedirect('http://authelia.example.com:9091/api/verify?rd=https://login.example.com:8080/%23/',
|
2019-04-11 02:27:18 +07:00
|
|
|
'https://login.example.com:8080/#/?rd=https://secure.example.com:8080/',
|
|
|
|
{
|
|
|
|
'X-Forwarded-Proto': 'https',
|
|
|
|
'X-Forwarded-Host': 'secure.example.com:8080',
|
|
|
|
'X-Forwarded-Uri': '/',
|
|
|
|
});
|
2019-02-10 05:20:37 +07:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|