-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
1,241 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const jsConfigurations = ['eslint:recommended']; | ||
|
||
const tsConfigurations = [ | ||
...jsConfigurations, | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
]; | ||
const tsRules = { | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
}; | ||
|
||
const testConfigurations = ['plugin:mocha/recommended']; | ||
|
||
module.exports = { | ||
parserOptions: { | ||
project: ['./tsconfig-lint.json'], | ||
}, | ||
plugins: ['@typescript-eslint', 'mocha'], | ||
env: { node: true }, | ||
overrides: [ | ||
{ | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
}, | ||
files: ['**/*.js'], | ||
env: { node: true, es6: true }, | ||
extends: [...jsConfigurations, 'prettier'], | ||
}, | ||
{ | ||
parser: '@typescript-eslint/parser', | ||
files: ['**/*.ts'], | ||
extends: [...tsConfigurations, 'prettier'], | ||
rules: { ...tsRules }, | ||
}, | ||
{ | ||
files: ['**/*.spec.js', '**/*.spec.ts'], | ||
env: { mocha: true }, | ||
extends: [...testConfigurations], | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,4 +192,5 @@ lib | |
**/*.js | ||
**/*.js.map | ||
!**/initdb/*.js | ||
*.tgz | ||
!.eslintrc.js | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
const path = require("path"); | ||
import path from 'path'; | ||
|
||
export default { | ||
dockerCompose: { | ||
projectName: path.basename(__dirname), | ||
yamlPath: path.resolve(__dirname, "docker-compose.yaml"), | ||
yamlPath: path.resolve(__dirname, 'docker-compose.yaml'), | ||
}, | ||
waitOn: ["tcp:27020"], | ||
waitOn: ['tcp:27020'], | ||
connections: { | ||
community: { | ||
connectionString: "mongodb://localhost:27020/test", | ||
connectionString: 'mongodb://localhost:27020/test', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
const path = require("path"); | ||
import path from 'path'; | ||
|
||
export default { | ||
dockerCompose: { | ||
projectName: path.basename(__dirname), | ||
yamlPath: path.resolve(__dirname, "docker-compose.yaml"), | ||
yamlPath: path.resolve(__dirname, 'docker-compose.yaml'), | ||
}, | ||
waitOn: ["tcp:27021"], | ||
waitOn: ['tcp:27021'], | ||
connections: { | ||
enterprise: { | ||
connectionString: "mongodb://localhost:27021/test", | ||
connectionString: 'mongodb://localhost:27021/test', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,13 @@ | |
|
||
Make sure you have this line in your `/etc/hosts`: | ||
|
||
``` conf | ||
```conf | ||
127.0.0.1 mongodb-kerberos-1.example.com mongodb-kerberos-2.example.com mongodb-kerberos-3.examplecrossrealm.com | ||
``` | ||
|
||
Make sure you have this in `/etc/krb5.conf` (note the `domain_realm` section to configure cross-realm): | ||
|
||
``` conf | ||
```conf | ||
[realms] | ||
EXAMPLE.COM = { | ||
kdc = localhost | ||
|
@@ -28,26 +28,26 @@ Make sure you have this in `/etc/krb5.conf` (note the `domain_realm` section to | |
|
||
Start the docker environment: | ||
|
||
``` sh | ||
```sh | ||
docker-compose -f kerberos/docker-compose.yaml up | ||
``` | ||
|
||
Authenticate with kdc (the password is `password`): | ||
|
||
``` sh | ||
```sh | ||
kinit [email protected] | ||
``` | ||
|
||
**Important:** To stop the environment, make sure to use the `-v` flag: | ||
|
||
``` sh | ||
```sh | ||
docker-compose -f kerberos/docker-compose.yaml down -v | ||
``` | ||
|
||
|
||
#### How to connect | ||
|
||
##### Kerberos Setup | ||
|
||
There are two Kerberos _Key Distribution Centers_ (KDCs) setup: `kdc-admin` and `kdc-admin2`. These two cover the `EXAMPLE.COM` and `EXAMPLE2.COM` realm respectively. All users listed below are registered in the `EXAMPLE.COM` realm. The service principals for `mongodb-kerberos-1` and `mongodb-kerberos-2` are also registered in the `EXAMPLE.COM` realm. The service principal for `mongodb-kerberos-3` is registered in the `EXAMPLE2.COM` realm. | ||
|
||
The two Kerberos installations have cross-realm authentication enabled so that `kdc-admin2` (realm `EXAMPLE2.COM`) **trusts** `kdc-admin` (realm `EXAMPLE.COM`). For details on how this cross-realm trust is configured refer to [Setting up Cross-Realm Kerberos Trusts](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system-level_authentication_guide/using_trusts). | ||
|
@@ -68,7 +68,7 @@ The server `mongodb-kerberos-3.examplecrossrealm.com` has the default `gssapiSer | |
|
||
##### Compass | ||
|
||
``` yaml | ||
```yaml | ||
hostname: mongodb-kerberos-1.example.com | ||
port: 29017 | ||
principal: [email protected] | ||
|
@@ -78,28 +78,32 @@ gssapiServiceName: mongodb | |
##### Connection string | ||
With as few properties as possible (`gssapiServiceName`, `authSource` will be inferred automatically) - does not work in the _old shell_: | ||
``` sh | ||
|
||
```sh | ||
mongodb://mongodb.user%[email protected]:29017/?authMechanism=GSSAPI | ||
``` | ||
|
||
With `authSource` for the old shell: | ||
``` sh | ||
|
||
```sh | ||
mongodb://mongodb.user%[email protected]:29017/?authMechanism=GSSAPI&authSource=%24external | ||
``` | ||
|
||
With an alternate service name using official `SERVICE_NAME` auth - does not work in the _old shell_: | ||
``` sh | ||
With an alternate service name using official `SERVICE_NAME` auth - does not work in the _old shell_: | ||
|
||
```sh | ||
mongodb://mongodb.user%[email protected]:29018/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:alternate | ||
``` | ||
|
||
With an alternate service name for the old shell: | ||
``` sh | ||
|
||
```sh | ||
mongodb://mongodb.user%[email protected]:29018/?gssapiServiceName=alternate&authMechanism=GSSAPI&authSource=%24external | ||
``` | ||
|
||
##### Shell (enterprise) | ||
|
||
``` sh | ||
```sh | ||
mongo \ | ||
--host mongodb-kerberos-1.example.com \ | ||
--port 29017 \ | ||
|
@@ -108,7 +112,7 @@ mongo \ | |
-u [email protected] | ||
``` | ||
|
||
``` sh | ||
```sh | ||
mongo \ | ||
--host mongodb-kerberos-2.example.com \ | ||
--port 29018 \ | ||
|
Oops, something went wrong.