| 
 | 1 | +package github  | 
 | 2 | + | 
 | 3 | +import (  | 
 | 4 | +	opengovernance "github.com/opengovern/og-describer-github/discovery/pkg/es"  | 
 | 5 | + | 
 | 6 | +	"github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto"  | 
 | 7 | +	"github.com/turbot/steampipe-plugin-sdk/v5/plugin"  | 
 | 8 | +	"github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform"  | 
 | 9 | +)  | 
 | 10 | + | 
 | 11 | +func gitHubOrganizationTokenColumns() []*plugin.Column {  | 
 | 12 | +	tableCols := []*plugin.Column{  | 
 | 13 | +		{  | 
 | 14 | +			Name:        "authorized_credential_id",  | 
 | 15 | +			Type:        proto.ColumnType_INT,  | 
 | 16 | +			Description: "The organization the member is associated with.",  | 
 | 17 | +			Transform:   transform.FromField("Description.AuthorizedCredentialId")},  | 
 | 18 | +		{  | 
 | 19 | +			Name:        "authorized_credential_title",  | 
 | 20 | +			Type:        proto.ColumnType_STRING,  | 
 | 21 | +			Description: "The role this user has in the organization. Returns null if information is not available to viewer.",  | 
 | 22 | +			Transform:   transform.FromField("Description.AuthorizedCredentialTitle")},  | 
 | 23 | +		{  | 
 | 24 | +			Name:      "authorized_credential_note",  | 
 | 25 | +			Type:      proto.ColumnType_STRING,  | 
 | 26 | +			Transform: transform.FromField("Description.AuthorizedCredentialNote")},  | 
 | 27 | +		{  | 
 | 28 | +			Name:        "authorized_credential_expires_at",  | 
 | 29 | +			Type:        proto.ColumnType_TIMESTAMP,  | 
 | 30 | +			Description: "permissions",  | 
 | 31 | +			Transform:   transform.FromField("Description.AuthorizedCredentialExpiresAt")},  | 
 | 32 | +		{  | 
 | 33 | +			Name:        "login",  | 
 | 34 | +			Type:        proto.ColumnType_STRING,  | 
 | 35 | +			Description: "login",  | 
 | 36 | +			Transform:   transform.FromField("Description.Login")},  | 
 | 37 | +		{  | 
 | 38 | +			Name:        "scopes",  | 
 | 39 | +			Description: "permissions",  | 
 | 40 | +			Type:        proto.ColumnType_JSON,  | 
 | 41 | +			Transform:   transform.FromField("Description.Scopes")},  | 
 | 42 | +		{  | 
 | 43 | +			Name:        "credential_id",  | 
 | 44 | +			Type:        proto.ColumnType_INT,  | 
 | 45 | +			Description: "permissions",  | 
 | 46 | +			Transform:   transform.FromField("Description.CredentialId")},  | 
 | 47 | +		{  | 
 | 48 | +			Name:        "credential_type",  | 
 | 49 | +			Type:        proto.ColumnType_STRING,  | 
 | 50 | +			Description: "permissions",  | 
 | 51 | +			Transform:   transform.FromField("Description.CredentialType")},  | 
 | 52 | +		{  | 
 | 53 | +			Name:        "credential_accessed_at",  | 
 | 54 | +			Type:        proto.ColumnType_TIMESTAMP,  | 
 | 55 | +			Description: "permissions",  | 
 | 56 | +			Transform:   transform.FromField("Description.CredentialAccessedAt")},  | 
 | 57 | +		{  | 
 | 58 | +			Name:        "credential_authorized_at",  | 
 | 59 | +			Type:        proto.ColumnType_TIMESTAMP,  | 
 | 60 | +			Description: "permissions",  | 
 | 61 | +			Transform:   transform.FromField("Description.CredentialAuthorizedAt")},  | 
 | 62 | +		{  | 
 | 63 | +			Name:        "token_last_eight",  | 
 | 64 | +			Type:        proto.ColumnType_STRING,  | 
 | 65 | +			Description: "permissions",  | 
 | 66 | +			Transform:   transform.FromField("Description.TokenLastEight")},  | 
 | 67 | +		{  | 
 | 68 | +			Name:        "fingerprint",  | 
 | 69 | +			Type:        proto.ColumnType_STRING,  | 
 | 70 | +			Description: "permissions",  | 
 | 71 | +			Transform:   transform.FromField("Description.Fingerprint")},  | 
 | 72 | +	}  | 
 | 73 | + | 
 | 74 | +	return tableCols  | 
 | 75 | +}  | 
 | 76 | + | 
 | 77 | +func tableGitHubOrganizationToken() *plugin.Table {  | 
 | 78 | +	return &plugin.Table{  | 
 | 79 | +		Name:        "github_organization_token",  | 
 | 80 | +		Description: "GitHub tokens for a given organization. GitHub Users are user accounts in GitHub.",  | 
 | 81 | +		List: &plugin.ListConfig{  | 
 | 82 | +			Hydrate: opengovernance.ListOrganizationToken,  | 
 | 83 | +		},  | 
 | 84 | +		Columns: commonColumns(gitHubOrganizationTokenColumns()),  | 
 | 85 | +	}  | 
 | 86 | +}  | 
0 commit comments