-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split authority #151
Split authority #151
Changes from all commits
e84b227
263cf6f
e4e2bc3
94b7545
d4b1ded
346dd15
14a75fe
3f3f925
77ee6d3
12739ce
423d24f
7d57ca4
5ade21d
b6ef418
8f245a9
374a7b9
33a5041
ee537b0
10a8ada
7ac3f98
fe02792
d5457e3
d06fd38
4f7642e
eea6019
fa1d573
50aa997
8d320a5
18255d8
e032078
5fd5f21
e45ed5d
ee20e42
b7b7c2a
8063c50
ca446c4
0812464
3d1d0a6
d2a1d30
1991882
9ccc679
666c64b
1434eb0
c0b00df
11d74cc
2785096
ff5e718
26ebba1
94a7622
8985b65
5bbda28
c9e0945
5f33aa3
1308a1b
c517b89
9b30681
b14ff46
bbcb8c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,10 @@ | |
|
||
#import "MSIDAADNetworkConfiguration.h" | ||
#import "MSIDAADEndpointProvider.h" | ||
#import "MSIDConstants.h" | ||
|
||
static MSIDAADNetworkConfiguration *s_defaultConfiguration; | ||
static NSSet<NSString *> *s_trustedHostList; | ||
|
||
@implementation MSIDAADNetworkConfiguration | ||
|
||
|
@@ -33,6 +35,15 @@ + (void)initialize | |
if (self == [MSIDAADNetworkConfiguration self]) | ||
{ | ||
s_defaultConfiguration = [MSIDAADNetworkConfiguration new]; | ||
|
||
s_trustedHostList = [NSSet setWithObjects:MSIDTrustedAuthority, | ||
MSIDTrustedAuthorityUS, | ||
MSIDTrustedAuthorityChina, | ||
MSIDTrustedAuthorityChina2, | ||
MSIDTrustedAuthorityGermany, | ||
MSIDTrustedAuthorityWorldWide, | ||
MSIDTrustedAuthorityUSGovernment, | ||
MSIDTrustedAuthorityCloudGovApi, nil]; | ||
} | ||
} | ||
|
||
|
@@ -59,4 +70,16 @@ + (void)setDefaultConfiguration:(MSIDAADNetworkConfiguration *)defaultConfigurat | |
s_defaultConfiguration = defaultConfiguration; | ||
} | ||
|
||
- (BOOL)isAADPublicCloud:(NSString *)host | ||
{ | ||
if (!host) return NO; | ||
|
||
return [s_trustedHostList containsObject:host]; | ||
} | ||
|
||
- (NSSet<NSString *> *)trustedHosts | ||
{ | ||
return s_trustedHostList; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: remove ; |
||
} | ||
|
||
@end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,17 @@ | |
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
extern NSString *const MSID_PLATFORM_KEY;//The SDK platform. iOS or OSX | ||
extern NSString *const MSID_VERSION_KEY; | ||
extern NSString *const MSID_CPU_KEY;//E.g. ARM64 | ||
extern NSString *const MSID_OS_VER_KEY;//iOS/OSX version | ||
extern NSString *const MSID_DEVICE_MODEL_KEY;//E.g. iPhone 5S | ||
extern NSString * _Nonnull const MSID_PLATFORM_KEY;//The SDK platform. iOS or OSX | ||
extern NSString * _Nonnull const MSID_VERSION_KEY; | ||
extern NSString * _Nonnull const MSID_CPU_KEY;//E.g. ARM64 | ||
extern NSString * _Nonnull const MSID_OS_VER_KEY;//iOS/OSX version | ||
extern NSString * _Nonnull const MSID_DEVICE_MODEL_KEY;//E.g. iPhone 5S | ||
|
||
extern NSString * _Nonnull const MSIDTrustedAuthority; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: can we follow the same format as other constants? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Decided to keep camel case constants and change upper case constants to camel case latter. |
||
extern NSString * _Nonnull const MSIDTrustedAuthorityUS; | ||
extern NSString * _Nonnull const MSIDTrustedAuthorityChina; | ||
extern NSString * _Nonnull const MSIDTrustedAuthorityChina2; | ||
extern NSString * _Nonnull const MSIDTrustedAuthorityGermany; | ||
extern NSString * _Nonnull const MSIDTrustedAuthorityWorldWide; | ||
extern NSString * _Nonnull const MSIDTrustedAuthorityUSGovernment; | ||
extern NSString * _Nonnull const MSIDTrustedAuthorityCloudGovApi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see a comment in another PR about making sure the list of authorities is up to date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done