Skip to content
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

[NEW] SAML quality improvements and new config options #17742

Merged
merged 73 commits into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
a5dc06b
Added settings for advanced SAML configuration
pierre-lehnen-rc May 25, 2020
dda6bb2
Converted SAML backend to typescript
pierre-lehnen-rc May 27, 2020
1fef657
Fixed references to IServiceProviderOptions type
pierre-lehnen-rc May 27, 2020
441f69b
Removed useless assignment to local variable
pierre-lehnen-rc May 27, 2020
2718708
Improved IServiceProviderOptions type usage
pierre-lehnen-rc May 27, 2020
fcc29a3
Fixed typescript errors and implemented the first unit test
pierre-lehnen-rc May 27, 2020
6397570
Merge branch 'develop' into advanced-saml
pierre-lehnen-rc May 27, 2020
40c37a9
fixed useless assignment to local variable
pierre-lehnen-rc May 28, 2020
00dc0fb
Removed useless checks by defining the callbackUrl along with every o…
pierre-lehnen-rc May 28, 2020
040f2c1
Fixed debug flag
pierre-lehnen-rc May 28, 2020
80ab516
Added more template tests
pierre-lehnen-rc May 28, 2020
87c08b2
Update xmlbuilder module to get the typescript definitions
pierre-lehnen-rc May 28, 2020
7e2b5ff
Added metadata tests
pierre-lehnen-rc May 28, 2020
e9e97b9
Fixed/Improved typescript definitions
pierre-lehnen-rc May 28, 2020
a61430f
New Tests to parse Logout Requests
pierre-lehnen-rc May 28, 2020
3b68e86
Unit Tests for LogoutResponse parser
pierre-lehnen-rc May 28, 2020
33b9701
Improved Typescript definitions
pierre-lehnen-rc May 28, 2020
390a7ce
Added first Response Validation test
pierre-lehnen-rc May 28, 2020
8d604a6
fixed ReferenceError
pierre-lehnen-rc May 29, 2020
2fbfd3f
Added missing meteor definition
pierre-lehnen-rc May 29, 2020
6b0239c
Add Additional Logs if no SAMLResponse param is received on a LogoutR…
pierre-lehnen-rc May 29, 2020
44acc32
Removed references to Meteor.users
pierre-lehnen-rc May 29, 2020
47bdaba
[FIX] SAML Logout sending wrong NameId (Closes #7194)
pierre-lehnen-rc May 29, 2020
70862b3
Improved the way we deal with a failed Logout
pierre-lehnen-rc May 29, 2020
a3fb162
Prevent code from trying to allocate an undefined buffer
pierre-lehnen-rc May 29, 2020
53d0018
Update package-lock
pierre-lehnen-rc May 29, 2020
2696c74
Organized the login handler code
pierre-lehnen-rc May 29, 2020
d5ff72d
Added declarations of Accounts missing methods
pierre-lehnen-rc May 29, 2020
0a70dbd
Completed Typescript conversion
pierre-lehnen-rc May 29, 2020
c98d7d4
Fixed default logout response
pierre-lehnen-rc May 30, 2020
078a751
New test for user mapping
pierre-lehnen-rc May 30, 2020
74a05a4
Improved logs and name/email overwrite
pierre-lehnen-rc May 30, 2020
684b8b1
Expanded the user field map setting
pierre-lehnen-rc May 30, 2020
2032626
Fixed exception and comments
pierre-lehnen-rc May 30, 2020
a8b7892
New settings to configure SAML service metadata XML template
pierre-lehnen-rc May 30, 2020
c92b584
fixed unit test dependencies
pierre-lehnen-rc Jun 1, 2020
5b140f6
Added tests for regexes and templates
pierre-lehnen-rc Jun 1, 2020
984ea3d
Added new tests for the field map setting
pierre-lehnen-rc Jun 1, 2020
2f62ed8
Added new Response Validations Tests
pierre-lehnen-rc Jun 1, 2020
a1b38a6
fixed issues with settings not being loaded
pierre-lehnen-rc Jun 1, 2020
9544061
[FIX] SAML channel adding does not support a multi-value "channels" c…
pierre-lehnen-rc Jun 2, 2020
f8aa083
Merge branch 'develop' into advanced-saml
pierre-lehnen-rc Jun 2, 2020
b7f8b12
Changed Custom Identifier to store the data inside 'services.saml'
pierre-lehnen-rc Jun 3, 2020
7be8537
Added Signature Tests
pierre-lehnen-rc Jun 3, 2020
f47c208
Improved Error Handling
pierre-lehnen-rc Jun 3, 2020
cf8a39b
Fixed validation of encrypted assertions
pierre-lehnen-rc Jun 3, 2020
b37af44
Added decryption tests
pierre-lehnen-rc Jun 3, 2020
7eb52ca
Added check for multi-value attribute
pierre-lehnen-rc Jun 3, 2020
857be5d
Updated description of the field mapping setting
pierre-lehnen-rc Jun 4, 2020
069ad60
Merge branch 'develop' into advanced-saml
pierre-lehnen-rc Jun 16, 2020
1b9546b
Added Logout Request ID to Logout Response Template Variables
pierre-lehnen-rc Jun 16, 2020
6f70089
Improved Template Settings descriptions
pierre-lehnen-rc Jun 16, 2020
e2508bb
Included inResponseToId in the LogoutRequest tests
pierre-lehnen-rc Jun 16, 2020
938727f
Merge branch 'develop' into advanced-saml
pierre-lehnen-rc Jun 17, 2020
3059ff9
Changed the default Logout Response template to include the <Status> …
pierre-lehnen-rc Jun 17, 2020
9c42820
Changed AuthnContext settings to include instructions on how to add m…
pierre-lehnen-rc Jun 17, 2020
cc6267f
Renamed uniqueId to newId
pierre-lehnen-rc Jun 18, 2020
febfceb
Removed redundant log method
pierre-lehnen-rc Jun 18, 2020
9ce8a92
Renamed uniqueId on the migration too
pierre-lehnen-rc Jun 18, 2020
416c1a3
Moved Meteor.wrapAsync to the method declaration
pierre-lehnen-rc Jun 18, 2020
54f21f8
Removed custom debounce function
pierre-lehnen-rc Jun 18, 2020
3b3a9d9
Replaced Meteor.call with a regular function call
pierre-lehnen-rc Jun 18, 2020
36aeb2b
Updated @ToDo items
pierre-lehnen-rc Jun 18, 2020
a1fa731
Unified migrations
pierre-lehnen-rc Jun 18, 2020
edcea11
Stop overwriting services.saml data on user creation
pierre-lehnen-rc Jun 18, 2020
462dc42
Improved typescript definitions
pierre-lehnen-rc Jun 19, 2020
80cf83e
Avoid redeclaring a method on every login call
pierre-lehnen-rc Jun 19, 2020
3b81e61
Improved comments of an edge case scenario
pierre-lehnen-rc Jun 19, 2020
2a9f599
Add new users to existing rooms
pierre-lehnen-rc Jun 19, 2020
d363d6f
Abort login when trying to use an invalid field map
pierre-lehnen-rc Jun 19, 2020
baf01d1
Create index by saml inResponseTo id
pierre-lehnen-rc Jun 19, 2020
d1d9ea2
Define saml service typescript definitions
pierre-lehnen-rc Jun 19, 2020
2e276d0
Merge branch 'develop' into advanced-saml
pierre-lehnen-rc Jun 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/meteor-accounts-saml/server/definition/IAttributeMapping.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export interface IAttributeMapping {
fieldName: string | Array<string>;
regex?: string;
template?: string;
}

export interface IUserDataMap {
customFields: Map<string, IAttributeMapping>;
attributeList: Set<string>;
identifier: {
type: string;
attribute?: string;
};
email: IAttributeMapping;
username: IAttributeMapping;
name: IAttributeMapping;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface IAuthorizeRequestVariables extends Record<string, string> {
newId: string;
instant: string;
callbackUrl: string;
entryPoint: string;
issuer: string;
identifierFormat: string;
authnContextComparison: string;
authnContext: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface ILogoutRequestVariables extends Record<string, string> {
newId: string;
instant: string;
idpSLORedirectURL: string;
issuer: string;
identifierFormat: string;
nameID: string;
sessionIndex: string;
}
5 changes: 5 additions & 0 deletions app/meteor-accounts-saml/server/definition/ILogoutResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface ILogoutResponse {
id: string;
response: string;
inResponseToId: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface ILogoutResponseVariables extends Record<string, string> {
newId: string;
instant: string;
idpSLORedirectURL: string;
issuer: string;
identifierFormat: string;
nameID: string;
sessionIndex: string;
inResponseToId: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface IMetadataVariables extends Record<string, string> {
issuer: string;
certificate: string;
identifierFormat: string;
callbackUrl: string;
sloLocation: string;
}
5 changes: 5 additions & 0 deletions app/meteor-accounts-saml/server/definition/ISAMLAction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface ISAMLAction {
actionName: string;
serviceName: string;
credentialToken: string;
}
4 changes: 4 additions & 0 deletions app/meteor-accounts-saml/server/definition/ISAMLAssertion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface ISAMLAssertion {
assertion: Element | Document;
xml: string;
}
11 changes: 11 additions & 0 deletions app/meteor-accounts-saml/server/definition/ISAMLGlobalSettings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface ISAMLGlobalSettings {
generateUsername: boolean;
nameOverwrite: boolean;
mailOverwrite: boolean;
immutableProperty: string;
defaultUserRole: string;
roleAttributeName: string;
roleAttributeSync: boolean;
userDataFieldMap: string;
usernameNormalize: string;
}
4 changes: 4 additions & 0 deletions app/meteor-accounts-saml/server/definition/ISAMLRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface ISAMLRequest {
id: string;
request: string;
}
23 changes: 23 additions & 0 deletions app/meteor-accounts-saml/server/definition/ISAMLUser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export interface ISAMLUser {
customFields: Map<string, any>;
emailList: Array<string>;
fullName: string | null;
roles: Array<string>;
eppn: string | null;

username?: string;
language?: string;
channels?: Array<string>;
samlLogin: {
provider: string | null;
idp: string;
idpSession: string;
nameID: string;
};

attributeList: Map<string, any>;
identifier: {
type: string;
attribute?: string;
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export interface IServiceProviderOptions {
provider: string;
entryPoint: string;
idpSLORedirectURL: string;
issuer: string;
cert: string;
privateCert: string;
privateKey: string;
customAuthnContext: string;
authnContextComparison: string;
defaultUserRole: string;
roleAttributeName: string;
roleAttributeSync: boolean;
allowedClockDrift: number;
signatureValidationType: string;
identifierFormat: string;
nameIDPolicyTemplate: string;
authnContextTemplate: string;
authRequestTemplate: string;
logoutResponseTemplate: string;
logoutRequestTemplate: string;
metadataCertificateTemplate: string;
metadataTemplate: string;
callbackUrl: string;

// The id attribute is filled midway through some operations
id?: string;
}
11 changes: 11 additions & 0 deletions app/meteor-accounts-saml/server/definition/callbacks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface ILogoutRequestValidateCallback {
(err: string | object | null, data?: Record<string, string | null> | null): void;
}

export interface ILogoutResponseValidateCallback {
(err: string | object | null, inResponseTo?: string | null): void;
}

export interface IResponseValidateCallback {
(err: string | object | null, profile?: Record<string, any> | null, loggedOut?: boolean): void;
}
7 changes: 5 additions & 2 deletions app/meteor-accounts-saml/server/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
import './saml_rocketchat';
import './saml_server';
import './startup';
import './loginHandler';
import './listener';
import './methods/samlLogout';
import './methods/addSamlService';
Loading