Quantcast
Channel: Feed of "gitea/terraform-provider-gitea"
Viewing all articles
Browse latest Browse all 64

tobiasbp opened issue gitea/terraform-provider-gitea#32

$
0
0

Describe the bug
The token example shows how to create a token for a user. However, that is not the
result of running the example. The token will created for the user defined in var.gitea_user, not the
user created in the example.

Here is the relevant code in the Gitea SDK. The username from the client (the authenticated user) is used to create the path/users/<username>/tokens.
The username supplied in the token resource is not used for anything, only the name of the token is used with the API.

The current token example:

provider "gitea" {  base_url = var.gitea_url  # Token Auth can not be used with this resource  username = var.gitea_username  password = var.gitea_password}resource "gitea_user" "test" {  username             = "test"  login_name           = "test"  password             = "Geheim1!"  email                = "test@user.dev"  must_change_password = false  admin                = true}resource "gitea_token" "test_token" {  username = resource.gitea_user.test.username  name     = "test-token"}

To Reproduce
Run the example. The token will be created for the account used to access the API. the test user will have no token.

Expected behavior
The token should be created for the test user, not the user accessing the API.

The documentation should be updated, to show who the token will be created for.

  • Provider Version: 0.3.0

Viewing all articles
Browse latest Browse all 64

Trending Articles