Skip to content

Commit 16a21e9

Browse files
authored
Merge pull request #71 from contentstack/feature/azure-na
Azure na region added
2 parents 48a072a + ed345dc commit 16a21e9

File tree

6 files changed

+69
-4
lines changed

6 files changed

+69
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ tap-html.html
1111
*html-report
1212
coverage
1313
.env
14-
.dccache
14+
.dccache
15+
dist/*

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22

33

4-
Copyright (c) 2016-2021 Contentstack
4+
Copyright (c) 2016-2022 Contentstack
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

SECURITY.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Security
2+
3+
Contentstack takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.
4+
5+
If you believe you have found a security vulnerability in any Contentstack-owned repository, please report it to us as described below.
6+
7+
## Reporting Security Issues
8+
9+
**Please do not report security vulnerabilities through public GitHub issues.**
10+
11+
Send email to [[email protected]](mailto:[email protected]).
12+
13+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
14+
15+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
16+
17+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
18+
* Full paths of source file(s) related to the manifestation of the issue
19+
* The location of the affected source code (tag/branch/commit or direct URL)
20+
* Any special configuration required to reproduce the issue
21+
* Step-by-step instructions to reproduce the issue
22+
* Proof-of-concept or exploit code (if possible)
23+
* Impact of the issue, including how an attacker might exploit the issue
24+
25+
This information will help us triage your report more quickly.
26+
27+
[https://www.contentstack.com/trust/](https://www.contentstack.com/trust/)

index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export class Utils {
2121
//Enum for Contentstack Region
2222
export enum Region {
2323
US = "us",
24-
EU = "eu"
24+
EU = "eu",
25+
AZURE_NA = "azure-na"
2526
}
2627

2728
//Enum for Contentstack CachePolicy

src/core/contentstackregion.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const ContentstackRegion = {
22
EU: "eu",
3-
US: "us"
3+
US: "us",
4+
AZURE_NA: "azure-na"
45
};
56

67
export default ContentstackRegion;

test/typescript/stack.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,41 @@ describe('Stack tests', () => {
130130
done();
131131
});
132132

133+
test('Stack initialization with Contentstack Config with fetchOptions, Azure-NA region test', done => {
134+
const config : Contentstack.Config = {
135+
api_key: 'api_key',
136+
delivery_token: 'delivery_token',
137+
environment: 'environment',
138+
region: Contentstack.Region.AZURE_NA,
139+
fetchOptions:{
140+
timeout: 2000,
141+
retryLimit: 4,
142+
retryDelay: 40
143+
}
144+
};
145+
const stack = Contentstack.Stack(config);
146+
147+
expect(stack.cachePolicy).toEqual(Contentstack.CachePolicy.IGNORE_CACHE);
148+
expect(stack.environment).toEqual('environment');
149+
expect(stack.config.host).toEqual('azure-na-cdn.contentstack.com');
150+
expect(stack.config.port).toEqual(443);
151+
expect(stack.config.version).toEqual("v3");
152+
expect(stack.fetchOptions.timeout).toEqual(2000);
153+
expect(stack.fetchOptions.retryLimit).toEqual(4);
154+
expect(stack.fetchOptions.retryDelay).toEqual(40);
155+
done();
156+
});
157+
158+
test('Stack initialization with region EU test', done => {
159+
const stack = Contentstack.Stack('api_key', 'delivery_token', 'environment', Contentstack.Region.AZURE_NA);
160+
expect(stack.cachePolicy).toEqual(Contentstack.CachePolicy.IGNORE_CACHE);
161+
expect(stack.environment).toEqual('environment');
162+
expect(stack.config.host).toEqual('azure-na-cdn.contentstack.com');
163+
expect(stack.config.port).toEqual(443);
164+
expect(stack.config.version).toEqual("v3");
165+
done();
166+
});
167+
133168
test('Stack initialization with region EU and fetchOptions test', done => {
134169
const stack = Contentstack.Stack('api_key', 'delivery_token', 'environment', Contentstack.Region.EU, {
135170
timeout: 2000

0 commit comments

Comments
 (0)