keystone.oauth1.backends.base module

class keystone.oauth1.backends.base.Oauth1DriverBase[source]

Bases: object

Interface description for an OAuth1 driver.

abstract authorize_request_token(request_token_id, user_id, role_ids)[source]

Authorize request token.

Parameters
  • request_token_id (string) – the id of the request token, to be authorized

  • user_id (string) – the id of the authorizing user

  • role_ids (list) – list of role ids to authorize

Returns

verifier

abstract create_access_token(request_id, access_token_duration)[source]

Create access token.

Parameters
  • request_id (string) – the id of the request token, to be deleted

  • access_token_duration (string) – duration of an access token

Returns

access_token_ref

abstract create_consumer(consumer_ref)[source]

Create consumer.

Parameters

consumer_ref (dict) – consumer ref with consumer name

Returns

consumer_ref

abstract create_request_token(consumer_id, requested_project, request_token_duration)[source]

Create request token.

Parameters
  • consumer_id (string) – the id of the consumer

  • requested_project_id (string) – requested project id

  • request_token_duration (string) – duration of request token

Returns

request_token_ref

abstract delete_access_token(user_id, access_token_id)[source]

Delete access token.

Parameters
  • user_id (string) – authorizing user id

  • access_token_id (string) – access token to delete

Returns

None

abstract delete_consumer(consumer_id)[source]

Delete consumer.

Parameters

consumer_id (string) – id of consumer to get

Returns

None.

abstract get_access_token(access_token_id)[source]

Get access token.

Parameters

access_token_id (string) – the id of the access token

Returns

access_token_ref

abstract get_consumer(consumer_id)[source]

Get consumer, returns the consumer id (key) and description.

Parameters

consumer_id (string) – id of consumer to get

Returns

consumer_ref

abstract get_consumer_with_secret(consumer_id)[source]

Like get_consumer(), but also returns consumer secret.

Returned dictionary consumer_ref includes consumer secret. Secrets should only be shared upon consumer creation; the consumer secret is required to verify incoming OAuth requests.

Parameters

consumer_id (string) – id of consumer to get

Returns

consumer_ref containing consumer secret

abstract get_request_token(request_token_id)[source]

Get request token.

Parameters

request_token_id (string) – the id of the request token

Returns

request_token_ref

abstract list_access_tokens(user_id)[source]

List access tokens.

Parameters

user_id (string) – search for access tokens authorized by given user id

Returns

list of access tokens the user has authorized

abstract list_consumers()[source]

List consumers.

Returns

list of consumers

abstract update_consumer(consumer_id, consumer_ref)[source]

Update consumer.

Parameters
  • consumer_id (string) – id of consumer to update

  • consumer_ref (dict) – new consumer ref with consumer name

Returns

consumer_ref

keystone.oauth1.backends.base.filter_consumer(consumer_ref)[source]

Filter out private items in a consumer dict.

‘secret’ is never returned.

Returns

consumer_ref

keystone.oauth1.backends.base.filter_token(access_token_ref)[source]

Filter out private items in an access token dict.

‘access_secret’ is never returned.

Returns

access_token_ref