Skip to content

Commit

Permalink
Merge pull request #47 from StackGuardian/release/v1.1.0-rc5
Browse files Browse the repository at this point in the history
Release/v1.1.0 rc5
  • Loading branch information
taherkk authored Dec 4, 2024
2 parents 74ef1d1 + 7652357 commit bf53e0f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs-templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ terraform {
provider "stackguardian" {
api_key = "<YOUR-API-KEY>" # Replace this with your API key
org_name = "<YOUR-ORG-NAME>" # Replace this with your organization name
api_uri = "https://testapi.qa.stackguardian.io" # Use testapi instead of production for testing
api_uri = "https://api.app.stackguardian.io"
}

# Create a StackGuardian Workflow Group
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ terraform {
provider "stackguardian" {
api_key = "<YOUR-API-KEY>" # Replace this with your API key
org_name = "<YOUR-ORG-NAME>" # Replace this with your organization name
api_uri = "https://testapi.qa.stackguardian.io" # Use testapi instead of production for testing
api_uri = "https://api.app.stackguardian.io"
}
# Create a StackGuardian Workflow Group
Expand Down
4 changes: 2 additions & 2 deletions internal/resource/role/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
const (
testAccResource = `
resource "stackguardian_workflow_group" "example_workflow_group" {
resource_name = "example-workflow-group"
resource_name = "example-workflow-group-role"
description = "Example of terraform-provider-stackguardian for Workflow Group"
tags = ["example-tag"]
}
Expand Down Expand Up @@ -40,7 +40,7 @@ resource "stackguardian_role" "example_role" {

testAccResourceUpdate = `
resource "stackguardian_workflow_group" "example_workflow_group" {
resource_name = "example-workflow-group"
resource_name = "example-workflow-group-role"
description = "Example of terraform-provider-stackguardian for Workflow Group"
tags = ["example-tag"]
}
Expand Down
11 changes: 9 additions & 2 deletions internal/resource/role_assignment/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,16 @@ func (m *RoleAssignmentResourceModel) ToGetAPIModel(ctx context.Context) (*sgsdk

func BuildAPIModelToRoleAssignmentModel(apiResponse *sgsdkgo.AddUserToOrganization) (*RoleAssignmentResourceModel, diag.Diagnostics) {
entityTypeValue := flatteners.String(string(*apiResponse.EntityType.Ptr()))
userID := strings.Split(apiResponse.UserId, "/")

var userID string
if strings.HasPrefix(apiResponse.UserId, "local/") {
userID = strings.Split(apiResponse.UserId, "/")[1]
} else {
userID = apiResponse.UserId
}

RoleModel := &RoleAssignmentResourceModel{
UserId: flatteners.String(userID[len(userID)-1]),
UserId: flatteners.String(userID),
Role: flatteners.String(apiResponse.Role),
EntityType: entityTypeValue,
}
Expand Down
4 changes: 2 additions & 2 deletions internal/resource/role_assignment/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resource "stackguardian_workflow_group" "example_workflow_group" {
}
resource "stackguardian_role" "example_role" {
resource_name = "example-role"
resource_name = "example-role-roleassignment"
description = "Example of terraform-provider-stackguardian for a Role"
tags = [
"example-org",
Expand Down Expand Up @@ -53,7 +53,7 @@ resource "stackguardian_workflow_group" "example_workflow_group" {
}
resource "stackguardian_role" "example_role" {
resource_name = "example-role"
resource_name = "example-role-roleassignment"
description = "Example of terraform-provider-stackguardian for a Role"
tags = [
"example-org",
Expand Down

0 comments on commit bf53e0f

Please sign in to comment.