action_test.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. package forms_test
  2. import (
  3. "encoding/base64"
  4. "testing"
  5. "github.com/porter-dev/porter/internal/forms"
  6. "github.com/porter-dev/porter/internal/kubernetes"
  7. "github.com/porter-dev/porter/internal/models"
  8. "github.com/porter-dev/porter/internal/repository/test"
  9. )
  10. func TestPopulateServiceAccountBasic(t *testing.T) {
  11. // create the in-memory repository
  12. repo := test.NewRepository(true)
  13. // create a new project
  14. repo.Project.CreateProject(&models.Project{
  15. Name: "test-project",
  16. })
  17. // create a ServiceAccountCandidate from a kubeconfig
  18. saCandidates, err := kubernetes.GetServiceAccountCandidates([]byte(ClusterCAWithData))
  19. if err != nil {
  20. t.Fatalf("%v\n", err)
  21. }
  22. for _, saCandidate := range saCandidates {
  23. repo.ServiceAccount.CreateServiceAccountCandidate(saCandidate)
  24. }
  25. // create a new form
  26. form := forms.ServiceAccountActionResolver{
  27. ServiceAccountCandidateID: 1,
  28. }
  29. err = form.PopulateServiceAccount(repo.ServiceAccount)
  30. if err != nil {
  31. t.Fatalf("%v\n", err)
  32. }
  33. sa, err := repo.ServiceAccount.CreateServiceAccount(form.SA)
  34. decodedStr, _ := base64.StdEncoding.DecodeString("LS0tLS1CRUdJTiBDRVJ=")
  35. if len(sa.Clusters) != 1 {
  36. t.Fatalf("cluster not written\n")
  37. }
  38. if sa.Clusters[0].ServiceAccountID != 1 {
  39. t.Errorf("service account ID of joined cluster is not 1")
  40. }
  41. if string(sa.Clusters[0].CertificateAuthorityData) != string(decodedStr) {
  42. t.Errorf("cluster ca data and input do not match: expected %s, got %s\n",
  43. string(sa.Clusters[0].CertificateAuthorityData), string(decodedStr))
  44. }
  45. if sa.AuthMechanism != "x509" {
  46. t.Errorf("service account auth mechanism is not x509")
  47. }
  48. if string(sa.ClientCertificateData) != string(decodedStr) {
  49. t.Errorf("service account cert data and input do not match: expected %s, got %s\n",
  50. string(sa.ClientCertificateData), string(decodedStr))
  51. }
  52. if string(sa.ClientKeyData) != string(decodedStr) {
  53. t.Errorf("service account key data and input do not match: expected %s, got %s\n",
  54. string(sa.ClientKeyData), string(decodedStr))
  55. }
  56. }
  57. func TestPopulateServiceAccountClusterDataAction(t *testing.T) {
  58. // create the in-memory repository
  59. repo := test.NewRepository(true)
  60. // create a new project
  61. repo.Project.CreateProject(&models.Project{
  62. Name: "test-project",
  63. })
  64. // create a ServiceAccountCandidate from a kubeconfig
  65. saCandidates, err := kubernetes.GetServiceAccountCandidates([]byte(ClusterCAWithoutData))
  66. if err != nil {
  67. t.Fatalf("%v\n", err)
  68. }
  69. for _, saCandidate := range saCandidates {
  70. repo.ServiceAccount.CreateServiceAccountCandidate(saCandidate)
  71. }
  72. // create a new form
  73. form := forms.ClusterCADataAction{
  74. ServiceAccountActionResolver: &forms.ServiceAccountActionResolver{
  75. ServiceAccountCandidateID: 1,
  76. },
  77. ClusterCAData: "LS0tLS1CRUdJTiBDRVJ=",
  78. }
  79. err = form.PopulateServiceAccount(repo.ServiceAccount)
  80. if err != nil {
  81. t.Fatalf("%v\n", err)
  82. }
  83. sa, err := repo.ServiceAccount.CreateServiceAccount(form.ServiceAccountActionResolver.SA)
  84. decodedStr, _ := base64.StdEncoding.DecodeString("LS0tLS1CRUdJTiBDRVJ=")
  85. if len(sa.Clusters) != 1 {
  86. t.Fatalf("cluster not written\n")
  87. }
  88. if sa.Clusters[0].ServiceAccountID != 1 {
  89. t.Errorf("service account ID of joined cluster is not 1")
  90. }
  91. if string(sa.Clusters[0].CertificateAuthorityData) != string(decodedStr) {
  92. t.Errorf("cluster ca data and input do not match: expected %s, got %s\n",
  93. string(sa.Clusters[0].CertificateAuthorityData), string(decodedStr))
  94. }
  95. if sa.AuthMechanism != "x509" {
  96. t.Errorf("service account auth mechanism is not x509")
  97. }
  98. if string(sa.ClientCertificateData) != string(decodedStr) {
  99. t.Errorf("service account cert data and input do not match: expected %s, got %s\n",
  100. string(sa.ClientCertificateData), string(decodedStr))
  101. }
  102. if string(sa.ClientKeyData) != string(decodedStr) {
  103. t.Errorf("service account key data and input do not match: expected %s, got %s\n",
  104. string(sa.ClientKeyData), string(decodedStr))
  105. }
  106. }
  107. func TestPopulateServiceAccountClientCertAction(t *testing.T) {
  108. // create the in-memory repository
  109. repo := test.NewRepository(true)
  110. // create a new project
  111. repo.Project.CreateProject(&models.Project{
  112. Name: "test-project",
  113. })
  114. // create a ServiceAccountCandidate from a kubeconfig
  115. saCandidates, err := kubernetes.GetServiceAccountCandidates([]byte(ClientWithoutCertData))
  116. if err != nil {
  117. t.Fatalf("%v\n", err)
  118. }
  119. for _, saCandidate := range saCandidates {
  120. repo.ServiceAccount.CreateServiceAccountCandidate(saCandidate)
  121. }
  122. // create a new form
  123. form := forms.ClientCertDataAction{
  124. ServiceAccountActionResolver: &forms.ServiceAccountActionResolver{
  125. ServiceAccountCandidateID: 1,
  126. },
  127. ClientCertData: "LS0tLS1CRUdJTiBDRVJ=",
  128. }
  129. err = form.PopulateServiceAccount(repo.ServiceAccount)
  130. if err != nil {
  131. t.Fatalf("%v\n", err)
  132. }
  133. sa, err := repo.ServiceAccount.CreateServiceAccount(form.ServiceAccountActionResolver.SA)
  134. decodedStr, _ := base64.StdEncoding.DecodeString("LS0tLS1CRUdJTiBDRVJ=")
  135. if len(sa.Clusters) != 1 {
  136. t.Fatalf("cluster not written\n")
  137. }
  138. if sa.Clusters[0].ServiceAccountID != 1 {
  139. t.Errorf("service account ID of joined cluster is not 1")
  140. }
  141. if string(sa.Clusters[0].CertificateAuthorityData) != string(decodedStr) {
  142. t.Errorf("cluster ca data and input do not match: expected %s, got %s\n",
  143. string(sa.Clusters[0].CertificateAuthorityData), string(decodedStr))
  144. }
  145. if sa.AuthMechanism != "x509" {
  146. t.Errorf("service account auth mechanism is not x509")
  147. }
  148. if string(sa.ClientCertificateData) != string(decodedStr) {
  149. t.Errorf("service account cert data and input do not match: expected %s, got %s\n",
  150. string(sa.ClientCertificateData), string(decodedStr))
  151. }
  152. if string(sa.ClientKeyData) != string(decodedStr) {
  153. t.Errorf("service account key data and input do not match: expected %s, got %s\n",
  154. string(sa.ClientKeyData), string(decodedStr))
  155. }
  156. }
  157. func TestPopulateServiceAccountClientCertAndKeyActions(t *testing.T) {
  158. // create the in-memory repository
  159. repo := test.NewRepository(true)
  160. // create a new project
  161. repo.Project.CreateProject(&models.Project{
  162. Name: "test-project",
  163. })
  164. // create a ServiceAccountCandidate from a kubeconfig
  165. saCandidates, err := kubernetes.GetServiceAccountCandidates([]byte(ClientWithoutCertAndKeyData))
  166. if err != nil {
  167. t.Fatalf("%v\n", err)
  168. }
  169. for _, saCandidate := range saCandidates {
  170. repo.ServiceAccount.CreateServiceAccountCandidate(saCandidate)
  171. }
  172. // create a new form
  173. form := forms.ClientCertDataAction{
  174. ServiceAccountActionResolver: &forms.ServiceAccountActionResolver{
  175. ServiceAccountCandidateID: 1,
  176. },
  177. ClientCertData: "LS0tLS1CRUdJTiBDRVJ=",
  178. }
  179. err = form.PopulateServiceAccount(repo.ServiceAccount)
  180. if err != nil {
  181. t.Fatalf("%v\n", err)
  182. }
  183. keyForm := forms.ClientKeyDataAction{
  184. ServiceAccountActionResolver: form.ServiceAccountActionResolver,
  185. ClientKeyData: "LS0tLS1CRUdJTiBDRVJ=",
  186. }
  187. err = keyForm.PopulateServiceAccount(repo.ServiceAccount)
  188. if err != nil {
  189. t.Fatalf("%v\n", err)
  190. }
  191. sa, err := repo.ServiceAccount.CreateServiceAccount(keyForm.ServiceAccountActionResolver.SA)
  192. decodedStr, _ := base64.StdEncoding.DecodeString("LS0tLS1CRUdJTiBDRVJ=")
  193. if len(sa.Clusters) != 1 {
  194. t.Fatalf("cluster not written\n")
  195. }
  196. if sa.Clusters[0].ServiceAccountID != 1 {
  197. t.Errorf("service account ID of joined cluster is not 1")
  198. }
  199. if string(sa.Clusters[0].CertificateAuthorityData) != string(decodedStr) {
  200. t.Errorf("cluster ca data and input do not match: expected %s, got %s\n",
  201. string(sa.Clusters[0].CertificateAuthorityData), string(decodedStr))
  202. }
  203. if sa.AuthMechanism != "x509" {
  204. t.Errorf("service account auth mechanism is not x509")
  205. }
  206. if string(sa.ClientCertificateData) != string(decodedStr) {
  207. t.Errorf("service account cert data and input do not match: expected %s, got %s\n",
  208. string(sa.ClientCertificateData), string(decodedStr))
  209. }
  210. if string(sa.ClientKeyData) != string(decodedStr) {
  211. t.Errorf("service account cert data and input do not match: expected %s, got %s\n",
  212. string(sa.ClientKeyData), string(decodedStr))
  213. }
  214. }
  215. func TestPopulateServiceAccountTokenDataAction(t *testing.T) {
  216. // create the in-memory repository
  217. repo := test.NewRepository(true)
  218. tokenData := "abcdefghijklmnop"
  219. // create a new project
  220. repo.Project.CreateProject(&models.Project{
  221. Name: "test-project",
  222. })
  223. // create a ServiceAccountCandidate from a kubeconfig
  224. saCandidates, err := kubernetes.GetServiceAccountCandidates([]byte(BearerTokenWithoutData))
  225. if err != nil {
  226. t.Fatalf("%v\n", err)
  227. }
  228. for _, saCandidate := range saCandidates {
  229. repo.ServiceAccount.CreateServiceAccountCandidate(saCandidate)
  230. }
  231. // create a new form
  232. form := forms.TokenDataAction{
  233. ServiceAccountActionResolver: &forms.ServiceAccountActionResolver{
  234. ServiceAccountCandidateID: 1,
  235. },
  236. TokenData: tokenData,
  237. }
  238. err = form.PopulateServiceAccount(repo.ServiceAccount)
  239. if err != nil {
  240. t.Fatalf("%v\n", err)
  241. }
  242. sa, err := repo.ServiceAccount.CreateServiceAccount(form.ServiceAccountActionResolver.SA)
  243. if len(sa.Clusters) != 1 {
  244. t.Fatalf("cluster not written\n")
  245. }
  246. if sa.Clusters[0].ServiceAccountID != 1 {
  247. t.Errorf("service account ID of joined cluster is not 1")
  248. }
  249. if sa.AuthMechanism != models.Bearer {
  250. t.Errorf("service account auth mechanism is not %s\n", models.Bearer)
  251. }
  252. if sa.Token != tokenData {
  253. t.Errorf("service account token data is wrong: expected %s, got %s\n",
  254. tokenData, sa.Token)
  255. }
  256. }
  257. func TestPopulateServiceAccountGCPKeyDataAction(t *testing.T) {
  258. // create the in-memory repository
  259. repo := test.NewRepository(true)
  260. gcpKeyData := []byte(`{"key": "data"}`)
  261. // create a new project
  262. repo.Project.CreateProject(&models.Project{
  263. Name: "test-project",
  264. })
  265. // create a ServiceAccountCandidate from a kubeconfig
  266. saCandidates, err := kubernetes.GetServiceAccountCandidates([]byte(GCPPlugin))
  267. if err != nil {
  268. t.Fatalf("%v\n", err)
  269. }
  270. for _, saCandidate := range saCandidates {
  271. repo.ServiceAccount.CreateServiceAccountCandidate(saCandidate)
  272. }
  273. // create a new form
  274. form := forms.GCPKeyDataAction{
  275. ServiceAccountActionResolver: &forms.ServiceAccountActionResolver{
  276. ServiceAccountCandidateID: 1,
  277. },
  278. GCPKeyData: string(gcpKeyData),
  279. }
  280. err = form.PopulateServiceAccount(repo.ServiceAccount)
  281. if err != nil {
  282. t.Fatalf("%v\n", err)
  283. }
  284. sa, err := repo.ServiceAccount.CreateServiceAccount(form.ServiceAccountActionResolver.SA)
  285. if len(sa.Clusters) != 1 {
  286. t.Fatalf("cluster not written\n")
  287. }
  288. if sa.Clusters[0].ServiceAccountID != 1 {
  289. t.Errorf("service account ID of joined cluster is not 1")
  290. }
  291. if sa.AuthMechanism != models.GCP {
  292. t.Errorf("service account auth mechanism is not %s\n", models.GCP)
  293. }
  294. if string(sa.GCPKeyData) != string(gcpKeyData) {
  295. t.Errorf("service account token data is wrong: expected %s, got %s\n",
  296. string(sa.GCPKeyData), string(gcpKeyData))
  297. }
  298. }
  299. func TestPopulateServiceAccountAWSKeyDataAction(t *testing.T) {
  300. // create the in-memory repository
  301. repo := test.NewRepository(true)
  302. // create a new project
  303. repo.Project.CreateProject(&models.Project{
  304. Name: "test-project",
  305. })
  306. // create a ServiceAccountCandidate from a kubeconfig
  307. saCandidates, err := kubernetes.GetServiceAccountCandidates([]byte(AWSEKSGetTokenExec))
  308. if err != nil {
  309. t.Fatalf("%v\n", err)
  310. }
  311. for _, saCandidate := range saCandidates {
  312. repo.ServiceAccount.CreateServiceAccountCandidate(saCandidate)
  313. }
  314. // create a new form
  315. form := forms.AWSDataAction{
  316. ServiceAccountActionResolver: &forms.ServiceAccountActionResolver{
  317. ServiceAccountCandidateID: 1,
  318. },
  319. AWSAccessKeyID: "ALSDKJFADSF",
  320. AWSSecretAccessKey: "ASDLFKJALSDKFJ",
  321. AWSClusterID: "cluster-test",
  322. }
  323. err = form.PopulateServiceAccount(repo.ServiceAccount)
  324. if err != nil {
  325. t.Fatalf("%v\n", err)
  326. }
  327. sa, err := repo.ServiceAccount.CreateServiceAccount(form.ServiceAccountActionResolver.SA)
  328. if len(sa.Clusters) != 1 {
  329. t.Fatalf("cluster not written\n")
  330. }
  331. if sa.Clusters[0].ServiceAccountID != 1 {
  332. t.Errorf("service account ID of joined cluster is not 1")
  333. }
  334. if sa.AuthMechanism != models.AWS {
  335. t.Errorf("service account auth mechanism is not %s\n", models.AWS)
  336. }
  337. if sa.AWSAccessKeyID != "ALSDKJFADSF" {
  338. t.Errorf("service account aws access key id is wrong: expected %s, got %s\n",
  339. "ALSDKJFADSF", sa.AWSAccessKeyID)
  340. }
  341. if sa.AWSSecretAccessKey != "ASDLFKJALSDKFJ" {
  342. t.Errorf("service account aws access secret key is wrong: expected %s, got %s\n",
  343. "ASDLFKJALSDKFJ", sa.AWSSecretAccessKey)
  344. }
  345. if sa.AWSClusterID != "cluster-test" {
  346. t.Errorf("service account aws cluster id is wrong: expected %s, got %s\n",
  347. "cluster-test", sa.AWSClusterID)
  348. }
  349. }
  350. func TestPopulateServiceAccountOIDCAction(t *testing.T) {
  351. // create the in-memory repository
  352. repo := test.NewRepository(true)
  353. // create a new project
  354. repo.Project.CreateProject(&models.Project{
  355. Name: "test-project",
  356. })
  357. // create a ServiceAccountCandidate from a kubeconfig
  358. saCandidates, err := kubernetes.GetServiceAccountCandidates([]byte(OIDCAuthWithoutData))
  359. if err != nil {
  360. t.Fatalf("%v\n", err)
  361. }
  362. for _, saCandidate := range saCandidates {
  363. repo.ServiceAccount.CreateServiceAccountCandidate(saCandidate)
  364. }
  365. // create a new form
  366. form := forms.OIDCIssuerDataAction{
  367. ServiceAccountActionResolver: &forms.ServiceAccountActionResolver{
  368. ServiceAccountCandidateID: 1,
  369. },
  370. OIDCIssuerCAData: "LS0tLS1CRUdJTiBDRVJ=",
  371. }
  372. err = form.PopulateServiceAccount(repo.ServiceAccount)
  373. if err != nil {
  374. t.Fatalf("%v\n", err)
  375. }
  376. sa, err := repo.ServiceAccount.CreateServiceAccount(form.ServiceAccountActionResolver.SA)
  377. if len(sa.Clusters) != 1 {
  378. t.Fatalf("cluster not written\n")
  379. }
  380. if sa.Clusters[0].ServiceAccountID != 1 {
  381. t.Errorf("service account ID of joined cluster is not 1")
  382. }
  383. if sa.AuthMechanism != models.OIDC {
  384. t.Errorf("service account auth mechanism is not %s\n", models.OIDC)
  385. }
  386. if string(sa.OIDCCertificateAuthorityData) != "LS0tLS1CRUdJTiBDRVJ=" {
  387. t.Errorf("service account key data and input do not match: expected %s, got %s\n",
  388. string(sa.OIDCCertificateAuthorityData), "LS0tLS1CRUdJTiBDRVJ=")
  389. }
  390. }
  391. const ClusterCAWithData string = `
  392. apiVersion: v1
  393. kind: Config
  394. clusters:
  395. - name: cluster-test
  396. cluster:
  397. server: https://localhost
  398. certificate-authority-data: LS0tLS1CRUdJTiBDRVJ=
  399. contexts:
  400. - context:
  401. cluster: cluster-test
  402. user: test-admin
  403. name: context-test
  404. users:
  405. - name: test-admin
  406. user:
  407. client-certificate-data: LS0tLS1CRUdJTiBDRVJ=
  408. client-key-data: LS0tLS1CRUdJTiBDRVJ=
  409. current-context: context-test
  410. `
  411. const ClusterCAWithoutData string = `
  412. apiVersion: v1
  413. kind: Config
  414. clusters:
  415. - name: cluster-test
  416. cluster:
  417. server: https://localhost
  418. certificate-authority: /fake/path/to/ca.pem
  419. contexts:
  420. - context:
  421. cluster: cluster-test
  422. user: test-admin
  423. name: context-test
  424. users:
  425. - name: test-admin
  426. user:
  427. client-certificate-data: LS0tLS1CRUdJTiBDRVJ=
  428. client-key-data: LS0tLS1CRUdJTiBDRVJ=
  429. current-context: context-test
  430. `
  431. const ClientWithoutCertData string = `
  432. apiVersion: v1
  433. kind: Config
  434. clusters:
  435. - name: cluster-test
  436. cluster:
  437. server: https://localhost
  438. certificate-authority-data: LS0tLS1CRUdJTiBDRVJ=
  439. contexts:
  440. - context:
  441. cluster: cluster-test
  442. user: test-admin
  443. name: context-test
  444. users:
  445. - name: test-admin
  446. user:
  447. client-certificate: /fake/path/to/ca.pem
  448. client-key-data: LS0tLS1CRUdJTiBDRVJ=
  449. current-context: context-test
  450. `
  451. const ClientWithoutCertAndKeyData string = `
  452. apiVersion: v1
  453. kind: Config
  454. clusters:
  455. - name: cluster-test
  456. cluster:
  457. server: https://localhost
  458. certificate-authority-data: LS0tLS1CRUdJTiBDRVJ=
  459. contexts:
  460. - context:
  461. cluster: cluster-test
  462. user: test-admin
  463. name: context-test
  464. users:
  465. - name: test-admin
  466. user:
  467. client-certificate: /fake/path/to/ca.pem
  468. client-key: /fake/path/to/ca.pem
  469. current-context: context-test
  470. `
  471. const BearerTokenWithoutData string = `
  472. apiVersion: v1
  473. kind: Config
  474. preferences: {}
  475. current-context: context-test
  476. clusters:
  477. - cluster:
  478. server: https://localhost
  479. name: cluster-test
  480. contexts:
  481. - context:
  482. cluster: cluster-test
  483. user: test-admin
  484. name: context-test
  485. users:
  486. - name: test-admin
  487. user:
  488. tokenFile: /path/to/token/file.txt
  489. `
  490. const GCPPlugin string = `
  491. apiVersion: v1
  492. kind: Config
  493. clusters:
  494. - name: cluster-test
  495. cluster:
  496. server: https://localhost
  497. certificate-authority-data: LS0tLS1CRUdJTiBDRVJ=
  498. users:
  499. - name: test-admin
  500. user:
  501. auth-provider:
  502. name: gcp
  503. contexts:
  504. - context:
  505. cluster: cluster-test
  506. user: test-admin
  507. name: context-test
  508. current-context: context-test
  509. `
  510. const AWSEKSGetTokenExec string = `
  511. apiVersion: v1
  512. clusters:
  513. - cluster:
  514. server: https://localhost
  515. certificate-authority-data: LS0tLS1CRUdJTiBDRVJ=
  516. name: cluster-test
  517. contexts:
  518. - context:
  519. cluster: cluster-test
  520. user: test-admin
  521. name: context-test
  522. current-context: context-test
  523. kind: Config
  524. preferences: {}
  525. users:
  526. - name: test-admin
  527. user:
  528. exec:
  529. apiVersion: client.authentication.k8s.io/v1alpha1
  530. command: aws
  531. args:
  532. - "eks"
  533. - "get-token"
  534. - "--cluster-name"
  535. - "cluster-test"
  536. `
  537. const OIDCAuthWithoutData string = `
  538. apiVersion: v1
  539. clusters:
  540. - cluster:
  541. server: https://localhost
  542. certificate-authority-data: LS0tLS1CRUdJTiBDRVJ=
  543. name: cluster-test
  544. contexts:
  545. - context:
  546. cluster: cluster-test
  547. user: test-admin
  548. name: context-test
  549. current-context: context-test
  550. kind: Config
  551. preferences: {}
  552. users:
  553. - name: test-admin
  554. user:
  555. auth-provider:
  556. config:
  557. client-id: porter-api
  558. id-token: token
  559. idp-issuer-url: https://localhost
  560. idp-certificate-authority: /fake/path/to/ca.pem
  561. name: oidc
  562. `