-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from cisco-ie/usage-chaining
Builder pattern, XPath parsing, deprecate insecure, change initialization
- Loading branch information
Showing
10 changed files
with
657 additions
and
159 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
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,6 +1,11 @@ | ||
-i https://pypi.org/simple | ||
enum34 | ||
futures ; python_version < '3.2' | ||
grpcio | ||
protobuf | ||
six | ||
asn1crypto==0.24.0 | ||
cffi==1.12.3 | ||
cryptography==2.7 | ||
enum34==1.1.6 | ||
futures==3.3.0 ; python_version < '3.2' | ||
grpcio==1.24.0 | ||
ipaddress==1.0.22 ; python_version < '3' | ||
protobuf==3.9.2 | ||
pycparser==2.19 | ||
six==1.12.0 |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Copyright 2019 Cisco Systems | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
The contents of this file are licensed under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with the | ||
License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
License for the specific language governing permissions and limitations under | ||
the License. | ||
""" | ||
|
||
import grpc | ||
|
||
|
||
class CiscoAuthPlugin(grpc.AuthMetadataPlugin): | ||
"""A gRPC AuthMetadataPlugin which adds username/password metadata to each call.""" | ||
|
||
def __init__(self, username, password): | ||
super(CiscoAuthPlugin, self).__init__() | ||
self.username = username | ||
self.password = password | ||
|
||
def __call__(self, context, callback): | ||
callback([("username", self.username), ("password", self.password)], None) |
Oops, something went wrong.