bce_credentials.py 1.1 KB

123456789101112131415161718192021222324252627
  1. # Copyright 2014 Baidu, Inc.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  4. # except in compliance with the License. You may obtain a copy of the License at
  5. #
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. #
  8. # Unless required by applicable law or agreed to in writing, software distributed under the
  9. # License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  10. # either express or implied. See the License for the specific language governing permissions
  11. # and limitations under the License.
  12. """
  13. Provides access to the BCE credentials used for accessing BCE services: BCE access key ID and
  14. secret access key.
  15. These credentials are used to securely sign requests to BCE services.
  16. """
  17. from baidubce import compat
  18. class BceCredentials(object):
  19. """
  20. Provides access to the BCE credentials used for accessing BCE services:
  21. BCE access key ID and secret access key.
  22. """
  23. def __init__(self, access_key_id, secret_access_key):
  24. self.access_key_id = compat.convert_to_bytes(access_key_id)
  25. self.secret_access_key = compat.convert_to_bytes(secret_access_key)