Documentation ¶
Index ¶
Constants ¶
View Source
const (
// Version - Current version of gh-sso.
VERSION = "0.0.1"
)
Variables ¶
View Source
var ( // EnterpriseQuery is a GraphQL query to validate a Github Enterprise Account. EnterpriseQuery struct { Enterprise struct { ID githubv4.String `graphql:"id"` Name githubv4.String `graphql:"name"` } `graphql:"enterprise(slug: $enterpriseName)"` } // EnterpriseUsersQuery is a GraphQL query to retrieve all users in an Enterprise. EnterpriseMembersQuery struct { Enterprise struct { Members struct { Edges []struct { Node struct { EnterpriseUserAccount struct { Login githubv4.String `graphql:"login"` Name githubv4.String `graphql:"name"` } `graphql:"... on EnterpriseUserAccount"` } `graphql:"node"` } `graphql:"edges"` PageInfo struct { EndCursor githubv4.String `graphql:"endCursor"` HasNextPage githubv4.Boolean `graphql:"hasNextPage"` } `graphql:"pageInfo"` } `graphql:"members(first: 100, after: $cursor)"` } `graphql:"enterprise(slug: $enterpriseName)"` } // EnterpriseSamlIdpUsersQuery is a GraphQL query for a Github Enterprise Account's SAML IDP User details. EnterpriseSamlIdpUsersQuery struct { Enterprise struct { OwnerInfo struct { SamlIdentityProvider struct { ExternalIdentities struct { Edges []struct { Node struct { Guid githubv4.String `graphql:"guid"` SamlIdentity struct { NameId githubv4.String `graphql:"nameId"` } `graphql:"samlIdentity"` User struct { Login githubv4.String `graphql:"login"` Name githubv4.String `graphql:"name"` } `graphql:"user"` } `graphql:"node"` } `graphql:"edges"` PageInfo struct { EndCursor githubv4.String `graphql:"endCursor"` HasNextPage githubv4.Boolean `graphql:"hasNextPage"` } `graphql:"pageInfo"` } `graphql:"externalIdentities(first: 100, after: $cursor)"` } `graphql:"samlIdentityProvider"` } `graphql:"ownerInfo"` } `graphql:"enterprise(slug: $enterpriseName)"` } // EnterpriseRepositoriesQuery lists the organizations in the enterprise. EnterpriseOrganizationsQuery struct { Enterprise struct { Organizations struct { Edges []struct { Node struct { Login githubv4.String `graphql:"login"` } `graphql:"node"` } `graphql:"edges"` PageInfo struct { EndCursor githubv4.String `graphql:"endCursor"` HasNextPage githubv4.Boolean `graphql:"hasNextPage"` } `graphql:"pageInfo"` } `graphql:"organizations(first: 100, after: $cursor1)"` } `graphql:"enterprise(slug: $enterpriseName)"` } // OrganizationQuery is a GraphQL query for a Github Organization. OrganizationQuery struct { Organization struct { ID githubv4.String `graphql:"id"` Name githubv4.String `graphql:"name"` } `graphql:"organization(login: $organizationName)"` } // OrganizationSamlIdpUsersQuery is a GraphQL query for a Github Organization SAML IDP Users. OrganizationSamlIdpUsersQuery struct { Organization struct { SamlIdentityProvider struct { ExternalIdentities struct { Edges []struct { Node struct { Guid githubv4.String `graphql:"guid"` SamlIdentity struct { NameId githubv4.String `graphql:"nameId"` Username githubv4.String `graphql:"username"` } `graphql:"samlIdentity"` User struct { Login githubv4.String `graphql:"login"` Name githubv4.String `graphql:"name"` } `graphql:"user"` } `graphql:"node"` } `graphql:"edges"` PageInfo struct { EndCursor githubv4.String `graphql:"endCursor"` HasNextPage githubv4.Boolean `graphql:"hasNextPage"` } `graphql:"pageInfo"` } `graphql:"externalIdentities(first: 100, after: $cursor)"` } `graphql:"samlIdentityProvider"` } `graphql:"organization(login: $organizationName)"` } // OrganizationRepositoriesQuery lists the repositories in the organization. OrganizationRepositoriesQuery struct { Organization struct { Name githubv4.String `graphql:"name"` Repositories struct { Edges []struct { Node struct { Name githubv4.String `graphql:"name"` } `graphql:"node"` } `graphql:"edges"` PageInfo struct { EndCursor githubv4.String `graphql:"endCursor"` HasNextPage githubv4.Boolean `graphql:"hasNextPage"` } `graphql:"pageInfo"` } `graphql:"repositories(first: 100, after: $cursor)"` } `graphql:"organization(login: $organizationName)"` } )
Functions ¶
Types ¶
type Config ¶
type Config struct { // GitHub API token. Token string `mapstructure:"token"` Enterprises []string `mapstructure:"enterprises,flow"` Organizations []string `mapstructure:"organizations,flow"` }
Configuration object.
type Enterprise ¶
type Enterprise struct { ID string Login string Name string Organizations map[string]Organization Users map[string]User }
Enterprise - Top-level enterprise.
type Organization ¶
type Organization struct { ID string Login string Name string Repositories map[string]Repository Users map[string]User }
Organization - Top-Level organization; also used for Enterprise member orgs.
type Repository ¶
type Repository struct {
Name string
}
Repository - Individual repository in an organization.
Click to show internal directories.
Click to hide internal directories.