Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identity: add an applicationcredentials users extension package #1436

Closed
kayrus opened this issue Feb 5, 2019 · 3 comments
Closed

Identity: add an applicationcredentials users extension package #1436

kayrus opened this issue Feb 5, 2019 · 3 comments

Comments

@kayrus
Copy link
Contributor

kayrus commented Feb 5, 2019

Openstack API ref: https://developer.openstack.org/api-ref/identity/v3/index.html?expanded=create-application-credential-detail#application-credentials

API methods to add:

Desired package path: gophercloud/openstack/identity/v3/extensions/applicationcredentials

struct draft:

type ApplicationCredential struct {
        ID           string `json:"id"`
        Name         string `json:"name"`
        Description  string `json:"description"`
        Unrestricted bool   `json:"unrestricted"`
        // Secret can be computed and returned by an API only once during the POST request
        Secret    string       `json:"secret"`
        ProjectID string       `json:"project_id"`
        // only role ID or/and role name could be sent in the POST request
        Roles     []roles.Role `json:"roles"`
        ExpiresAt string       `json:"expires_at"`
}
@jtopjian
Copy link
Contributor

jtopjian commented Feb 6, 2019

@kayrus I'm doing a trial of allowing people to do full CRUD in a single PR. Feel free to go ahead if you'd like.

Small nit, but ExpiresAt should be time.Time.

Also, with regard to Roles, if you're able to re-use the Roles struct from the roles package, go for it. But if it doesn't work for some reason, you can create a applicationcredentials.Roles struct.

@kayrus
Copy link
Contributor Author

kayrus commented Feb 7, 2019

@jtopjian glad to hear that. Indeed, Role struct from the role package is not suitable, I had to introduce independent one.

@kayrus
Copy link
Contributor Author

kayrus commented Feb 8, 2019

@jtopjian, looks like the application credential is not an extension, but a built-in auth method. It is descripbed directly inside the https://developer.openstack.org/api-ref/identity/v3/, despite of extension auth methods like OAuth1 or Trusts. Therefore I'd consider to put it directly into the gophercloud/openstack/identity/v3 path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants