Skip to content

Commit 2c843da

Browse files
committed
Split kerberos example into separate file
1 parent fa8ea45 commit 2c843da

File tree

2 files changed

+33
-24
lines changed

2 files changed

+33
-24
lines changed

test/examples/auth_example.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
from neo4j.v1 import GraphDatabase
2323
# end::basic-auth-import[]
2424

25-
# tag::kerberos-auth-import[]
26-
from neo4j.v1 import kerberos_auth
27-
# end::kerberos-auth-import[]
28-
2925

3026
class BasicAuthExample:
3127
# tag::basic-auth[]
@@ -39,23 +35,3 @@ def close(self):
3935
def can_connect(self):
4036
result = self._driver.session().run("RETURN 1")
4137
return result.single()[0] == 1
42-
43-
44-
class KerberosAuthExample:
45-
# tag::kerberos-auth[]
46-
def __init__(self, uri, ticket):
47-
self._driver = GraphDatabase.driver(uri, auth=kerberos_auth(ticket))
48-
# end::kerberos-auth[]
49-
50-
def close(self):
51-
self._driver.close()
52-
53-
54-
class CustomAuthExample:
55-
# tag::custom-auth[]
56-
def __init__(self, uri, principal, credentials, realm, scheme, parameters):
57-
self._driver = GraphDatabase.driver(uri, auth=(principal, credentials, realm, scheme, parameters))
58-
# end::custom-auth[]
59-
60-
def close(self):
61-
self._driver.close()
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env python
2+
# -*- encoding: utf-8 -*-
3+
4+
# Copyright (c) 2002-2017 "Neo Technology,"
5+
# Network Engine for Objects in Lund AB [http://neotechnology.com]
6+
#
7+
# This file is part of Neo4j.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
21+
# tag::kerberos-auth-import[]
22+
from neo4j.v1 import GraphDatabase, kerberos_auth
23+
# end::kerberos-auth-import[]
24+
25+
26+
class KerberosAuthExample:
27+
# tag::kerberos-auth[]
28+
def __init__(self, uri, ticket):
29+
self._driver = GraphDatabase.driver(uri, auth=kerberos_auth(ticket))
30+
# end::kerberos-auth[]
31+
32+
def close(self):
33+
self._driver.close()

0 commit comments

Comments
 (0)