github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/identity/v3/federation/mappings/testing/fixtures.go (about) 1 package testing 2 3 import ( 4 "fmt" 5 ) 6 7 const ( 8 mappingID = "ACME" 9 10 listURI = "/OS-FEDERATION/mappings" 11 ) 12 13 var ( 14 mappingURI = fmt.Sprintf("%s/%s", listURI, mappingID) 15 16 mappingResponse = fmt.Sprintf(` 17 { 18 "mapping": { 19 "id": "%s", 20 "rules":[ 21 { 22 "local": [ 23 { 24 "user": { 25 "name": "{0}" 26 } 27 }, 28 { 29 "groups": "[\"admin\",\"manager\"]" 30 } 31 ], 32 "remote": [ 33 { 34 "type": "uid" 35 } 36 ] 37 } 38 ], 39 "links": { 40 "self": "https://example.com/v3/OS-FEDERATION/mappings/ACME" 41 } 42 } 43 } 44 `, mappingID) 45 46 mappingListResponse = fmt.Sprintf(` 47 { 48 "mappings": [ 49 { 50 "id": "%s", 51 "links": { 52 "self": "https://example.com/v3/OS-FEDERATION/mappings/ACME" 53 } 54 }, 55 { 56 "id": "ACME-contractors", 57 "rules":[ 58 { 59 "local": [ 60 { 61 "user": { 62 "name": "{0}" 63 } 64 }, 65 { 66 "groups": "[\"admin\",\"manager\"]" 67 } 68 ], 69 "remote": [ 70 { 71 "type": "uid" 72 } 73 ] 74 } 75 ], 76 "links": { 77 "self": "https://example.com/v3/OS-FEDERATION/identity_mappings/ACME" 78 } 79 } 80 ], 81 "links": { 82 "self": "https://example.com/v3/OS-FEDERATION/mappings" 83 } 84 } 85 `, mappingID) 86 87 updatedMappingResponse = fmt.Sprintf(` 88 { 89 "mapping": { 90 "id": "%s", 91 "rules": [ 92 { 93 "local": [ 94 { 95 "user": { 96 "name": "samltestid-{0}" 97 } 98 } 99 ], 100 "remote": [ 101 { 102 "type": "uid" 103 } 104 ] 105 } 106 ], 107 "links": { 108 "self": "https://example.com/v3/OS-FEDERATION/mappings/ACME" 109 } 110 } 111 } 112 `, mappingID) 113 )